mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-03-01 15:30:36 +01:00
Fixed duplicate slashes in source file URLs
This commit is contained in:
parent
7cf7ff98a2
commit
b3e293ece9
@ -145,9 +145,13 @@
|
|||||||
{% block source %}
|
{% block source %}
|
||||||
{% if page and page.meta and page.meta.source %}
|
{% if page and page.meta and page.meta.source %}
|
||||||
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
||||||
|
{% set repo = config.repo_url %}
|
||||||
|
{% if repo | last == "/" %}
|
||||||
|
{% set repo = repo[:-1] %}
|
||||||
|
{% endif %}
|
||||||
{% set path = page.meta.path | default([""]) %}
|
{% set path = page.meta.path | default([""]) %}
|
||||||
{% set file = page.meta.source %}
|
{% set file = page.meta.source %}
|
||||||
<a href="{{ [config.repo_url, path, file] | join('/') }}" title="{{ file }}" class="md-source-file">
|
<a href="{{ [repo, path, file] | join('/') }}" title="{{ file }}" class="md-source-file">
|
||||||
{{ file }}
|
{{ file }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -276,9 +276,13 @@
|
|||||||
{% block source %}
|
{% block source %}
|
||||||
{% if page and page.meta and page.meta.source %}
|
{% if page and page.meta and page.meta.source %}
|
||||||
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
<h2 id="__source">{{ lang.t("meta.source") }}</h2>
|
||||||
|
{% set repo = config.repo_url %}
|
||||||
|
{% if repo | last == "/" %}
|
||||||
|
{% set repo = repo[:-1] %}
|
||||||
|
{% endif %}
|
||||||
{% set path = page.meta.path | default([""]) %}
|
{% set path = page.meta.path | default([""]) %}
|
||||||
{% set file = page.meta.source %}
|
{% set file = page.meta.source %}
|
||||||
<a href="{{ [config.repo_url, path, file] | join('/') }}"
|
<a href="{{ [repo, path, file] | join('/') }}"
|
||||||
title="{{ file }}" class="md-source-file">
|
title="{{ file }}" class="md-source-file">
|
||||||
{{ file }}
|
{{ file }}
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user