-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(assets): Handle more assets #256
Conversation
The issue with #252 is unfortunately not related to this PR as per my comment Can you elaborate on what if fixes exactly on #251 please? A simple and clear example would help me a lot! |
Bummer 😞, it definitely fixes my issue where the assets are placed in the overrides, because I tested it with my setup. Issue 1 from #251 as explained in the first comment. Today I won't be at my PC so I won't be be able to create any example till tomorrow. |
@kamilkrzyskow
However, this plan would not accommodate cases where various files in various directories load the same template.
At this time, if all files index.md, index.pl.md, index.cs.md, nested/nested.md, nested/nested.pl.md, nested/nested.cs.md refer to the main.html template, the main. I don't think I can represent the path from html to test.drawio.svg statically. sample project is here -> https://github.com/AngryMane/sample-mkdocs-prj |
@kamilkrzyskow |
@ultrabug's suggestion may be a smart way to handle this. or, use abs path like '<img src="/assets/images/test.drawio.svg" width="100" height="100" />' |
OK, AngryMane's example and Ultrabug's solution made it clear that this PR indeed doesn't fix #252 as the hardcoded links, in the html templates, are unaffected by the changes. I agree, that Ultrabug's suggestion seems to be the most optimal, as for the abs path like Moving back on topic of this PR: No matter if it's nested or not, when building alternates MkDocs logs a warning:
The warning stems from the fact that alternates don't add the assets directory to the I hope this cleared things up @ultrabug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AngryMane and @kamilkrzyskow
I understand better now what you're trying to fix and thank you for providing everything.
I'd just like to propose this version instead which looks clearer to me?
02ce67c
to
c206045
Compare
Thanks @kamilkrzyskow and @AngryMane |
Some assets (like images) might stay the same across different language builds, as in no localized version is available.
Currently only the default language adds the files to the internal
files
list and built alternates show a warning that a file isn't found in the documentation files.This PR tries to fix just that by always including any non
.md
file to the build, so that would include.png
.jpg
.js
etc. files.As far as I know, the files aren't being duplicated in the alternate builds, just that the path to them is properly resolved.
It partially helps with #251
EDIT:
Actually, unrelated to #252