Closed dimejo closed 6 months ago
Hi, thank you for reporting the issue. Unfortunately I'm severely lacking the time at the moment but I will look into this in a couple of weeks. Thank you for linking the repo for reproducing the issue, that will help a lot with debugging.
Hi, sorry for the late response. The issue here lies in https://github.com/dimejo/kirby-tailwind-static/blob/main/site/snippets/image.php#L11 which you copied from the new starterkit. The snippet escapes the image url which then breaks the part of the site generator which replaces the temporary full/absolute base url (which is needed for kirby) with the one you've set up.
You can solve this on your side by not using esc
in conjunction with src
or href
. In your concrete example, that means replacing https://github.com/dimejo/kirby-tailwind-static/blob/main/site/snippets/image.php#L11 with
src="<?= $src ?>"
@jonathan-reisdorf:
Thanks for the pointer. Using the esc()
helper works, but not in combination with 'attr'
it seems. What confused me was the fact that it works on a live site, but not with this plugin. Hence I suspected a bug in this plugin.
I have build a small project that is supposed to be a boilerplate for future static sites with Kirby. The project only consists of Kirby 4, the Starterkit and kirby3-static-site-generator. The site is automatically build by running a build.php script via Github Actions and then deployed to Github Pages. Everything is working well but I noticed that some images are not loaded because 'https://d4l-ssg-base-url' is used as
$baseUrl
instead of '/kirby-tailwind-static'.URLs having this issue: https://dimejo.github.io/kirby-tailwind-static/about/ https://dimejo.github.io/kirby-tailwind-static/notes/exploring-the-universe/
The corresponding code seems to be generated by this snippet, but as I'm completely new to Kirby I have no idea what is going on.