Closed markstickley closed 11 months ago
Further investigations lead me to conclude that when the mkdocs site_url
is not set explicitly (as in my case) config.get
is not returning the falsey value expected here and so the default of /
is not being set. I guess it's somehow being set to None
or a string value of "None"
but as I haven't written python before this is way outside of my wheelhouse.
Interestingly even if this was fixed, it still wouldn't solve for my use case of needing a relative path to the image not based off the root folder (i.e. for a markdown file in the root I would need the img
src path to be ../images/kroki_generated/filename.svg
). With my settings the last version that did that the way I expected was 0.3.0... But that's out of scope for this issue I think.
I agree that this is a bug and to be honest, I think the fallback value for the site_url should be "" instead of "/", so relative urls keep working. A workaround that worked for me was to add the following to my mkdocs.yml: site_url: ""
This fixes the problem with the images, while still keeping the site as a whole functional.
Like @markstickley says, fix doesn't resolve relative path for image. Workaround doesn't work for relative paths. Would be great if downloaded images generated the correct relative path.
For those interested, an absolute path/url is needed for site_url
if you are using nested directories. Not the best solution when trying to test mkdocs-kroki-plugin
build step locally
Plugin version: 0.6.1
mkdocs.yaml:
Generated image tag:
Note that without the
DownloadDir
config option, thesrc
is justNonekrokitest-577414e8fb4a6f6ddb993d1827fd6937.svg
The svg is being generated and saved just fine, it's the html img tag that has the problem.