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
Branches
Tags
No related merge requests found
......@@ -145,9 +145,13 @@
{% block source %}
{% if page and page.meta and page.meta.source %}
<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 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 }}
</a>
{% endif %}
......
......@@ -276,9 +276,13 @@
{% block source %}
{% if page and page.meta and page.meta.source %}
<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 file = page.meta.source %}
<a href="{{ [config.repo_url, path, file] | join('/') }}"
<a href="{{ [repo, path, file] | join('/') }}"
title="{{ file }}" class="md-source-file">
{{ file }}
</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment