1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 09:20:52 +01:00

Fixed relative homepage links for nested pages when building locally

This commit is contained in:
squidfunk 2020-10-18 11:52:29 +02:00
parent d7ce2e9040
commit 48b4120b8f
4 changed files with 6 additions and 6 deletions

View File

@ -2,8 +2,8 @@
This file was automatically generated - do not edit
-#}
{% set site_url = config.site_url | default(nav.homepage.url, true) | url %}
{% if not config.use_directory_urls and site_url == "." %}
{% set site_url = site_url ~ "/index.html" %}
{% if not config.use_directory_urls and site_url[0] == site_url[-1] == "." %}
{% set site_url = site_url ~ "/index.html" | url %}
{% endif %}
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">

View File

@ -2,7 +2,7 @@
This file was automatically generated - do not edit
-#}
{% set site_url = config.site_url | default(nav.homepage.url, true) | url %}
{% if not config.use_directory_urls and site_url == "." %}
{% if not config.use_directory_urls and site_url[0] == site_url[-1] == "." %}
{% set site_url = site_url ~ "/index.html" %}
{% endif %}
<nav class="md-nav md-nav--primary" aria-label="{{ lang.t('nav.title') }}" data-md-level="0">

View File

@ -22,8 +22,8 @@
<!-- Mitigate bug: https://github.com/mkdocs/mkdocs/issues/2191 -->
{% set site_url = config.site_url | default(nav.homepage.url, true) | url %}
{% if not config.use_directory_urls and site_url == "." %}
{% set site_url = site_url ~ "/index.html" %}
{% if not config.use_directory_urls and site_url[0] == site_url[-1] == "." %}
{% set site_url = site_url ~ "/index.html" | url %}
{% endif %}
<!-- Application header -->

View File

@ -22,7 +22,7 @@
<!-- Mitigate bug: https://github.com/mkdocs/mkdocs/issues/2191 -->
{% set site_url = config.site_url | default(nav.homepage.url, true) | url %}
{% if not config.use_directory_urls and site_url == "." %}
{% if not config.use_directory_urls and site_url[0] == site_url[-1] == "." %}
{% set site_url = site_url ~ "/index.html" %}
{% endif %}