-
-
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
Links in mkdocs templates are no longer referenced correctly #252
Comments
Could be related to the issue I have, more details #251 (comment) |
Yes, seems to be the same. |
Actually what changed is that the 1.0.0 version behaves better and stopped copying the same non localized assets to the language folders. On your project @UlricusR the 0.5x version of the plugin generates:
While the 1.0.3 version of the plugin generates:
The resulting localized site is way smaller and the build more efficient of course. The first fix I can think of and tried on your source is to use the diff --git a/portfolio-page/material/.overrides/home-de.html b/portfolio-page/material/.overrides/home-de.html
index f60a269..3713cd2 100644
--- a/portfolio-page/material/.overrides/home-de.html
+++ b/portfolio-page/material/.overrides/home-de.html
@@ -2,9 +2,9 @@
<!-- Custom front matter -->
{% block extrahead %}
-<link rel="stylesheet" href="assets/stylesheets/owl.carousel.min.css">
-<link rel="stylesheet" href="assets/stylesheets/owl.theme.default.min.css">
-<link rel="stylesheet" href="assets/stylesheets/home.css">
+<link rel="stylesheet" href="{{ 'assets/stylesheets/owl.carousel.min.css' | url }}">
+<link rel="stylesheet" href="{{ 'assets/stylesheets/owl.theme.default.min.css' | url }}">
+<link rel="stylesheet" href="{{ 'assets/stylesheets/home.css' | url }}">
{{ super() }}
{% endblock %}
@@ -13,7 +13,7 @@
<div class="owl-carousel owl-theme">
<div class="item">
<div class="img-gradient">
- <img class="owl-background" src="assets/images/pizza-4968645_1920.jpg" alt="EasyFPE" />
+ <img class="owl-background" src="{{ 'assets/images/pizza-4968645_1920.jpg' | url }}" alt="EasyFPE" />
</div>
<div class="owl-central">
<h1 class="owl-title">EasyFPE</h1>
@@ -27,7 +27,7 @@
</div>
<div class="item">
<div class="img-gradient">
- <img class="owl-background" src="assets/images/joomla_wallpaper.png" alt="Joomla!-Erweiterungen" />
+ <img class="owl-background" src="{{ 'assets/images/joomla_wallpaper.png' | url }}" alt="Joomla!-Erweiterungen" />
</div>
<div class="owl-central">
<h1 class="owl-title">Joomla!-Erweiterungen</h1>
@@ -44,8 +44,8 @@
{% endblock %}
{% block scripts %}
-<script src="assets/javascripts/jquery.min.js"></script>
-<script src="assets/javascripts/owl.carousel.min.js"></script>
+<script src="{{ 'assets/javascripts/jquery.min.js' | url }}"></script>
+<script src="{{ 'assets/javascripts/owl.carousel.min.js' | url }}"></script>
<script type="text/javascript">
$('.owl-carousel').owlCarousel({
items:1, |
Thanks, the jinja filter fix helped - and is actually very elegant as solution. Appreciated :-) |
I have the following configuration with mkdocs-static-i18n release 1.0.2:
In my localized (German) index.de.md, I reference a customized template, stored in material/.overrides:
Within this template html file (home-de.html), I use links to (non-localized) images stored in docs/assets/images like as follows:
<img class="owl-background" src="assets/images/pizza-4968645_1920.jpg" alt="EasyFPE" />
When building the site, the localized de/index.html file cannot find these images:
WARNING - [20:06:15] "GET /de/assets/images/pizza-4968645_1920.jpg HTTP/1.1" code 404
Reason: No
de/assets
folder - the link should be../assets/images/pizza-4968645_1920.jpg
.It used to work in the 0.x version.
The text was updated successfully, but these errors were encountered: