Skip to content
Snippets Groups Projects
Commit b3e293ec authored by squidfunk's avatar squidfunk Committed by Martin Donath
Browse files

Fixed duplicate slashes in source file URLs

parent 7cf7ff98
No related branches found
No related tags found
No related merge requests found
...@@ -145,9 +145,13 @@ ...@@ -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 @@ ...@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment