Use relative path for forge links

This commit is contained in:
southerntofu 2021-01-13 16:51:45 +01:00
parent a9ce057398
commit 2d112f9ab3
1 changed files with 3 additions and 3 deletions

View File

@ -50,12 +50,12 @@
<footer>
{% block footer %}
{# TAXONOMY: no path here, so no source #}
{% set cur_path = section.path|default(value=page.path|default(value="")) %}
{% set cur_path = section.relative_path|default(value=page.relative_path|default(value="")) %}
{% if config.extra.forge and cur_path %}
<aside class="source">
{% set translated = trans(key="source", lang=lang) %}
{% set path = widgets::strip_lang_from_path(path=cur_path, lang=lang) %}
<a href="{{ config.extra.forge.browse }}content/{{ path }}{% if section %}_{% endif %}index{% if lang != config.default_language %}.{{ lang }}{% endif %}.md">{{ translated }}</a>
{% set browse_url = config.extra.forge.browse | trim_end_matches(pat="/") %}
<a href="{{ browse_url }}/content/{{ cur_path }}">{{ translated }}</a>
</aside>
{% endif %}
{% endblock footer %}