Commit 582890c2 authored by Crise's avatar Crise

make the git url able to be overwritten by sub projects

parent eeed889d
......@@ -28,6 +28,7 @@
{%- set privacy_link = privacy_link | default('//' ~ default_domain ~ '/privacy#privacy') -%}
{%- set cookie_link = cookie_link | default('//' ~ default_domain ~ '/privacy#cookies') -%}
{%- set info_link = info_link | default('//' ~ default_domain ~ '/privacy#open_source') -%}
{%- set git_base_url = (constant('GIT_PUBLIC_URL') is not defined) ? false : (git_base_url | default(constant('GIT_PUBLIC_URL'))) -%}
<!DOCTYPE html>
<html lang="en">
......@@ -133,8 +134,8 @@
<small class="float-right d-none d-lg-inline d-print-none">
{{ util.git_stats(git_info) }} {{ util.page_stats() }} |
{% if source_view -%}
{% if git_info and constant('GIT_PUBLIC_URL') is defined -%}
<a class="history-link" href="{{ constant('GIT_PUBLIC_URL') ~ '/commits/master' ~ git_info.file }}" rel="nofollow">History</a> |
{% if git_info and git_base_url -%}
<a class="history-link" href="{{ make_url(git_base_url ~ '/commits/master' ~ git_info.file) }}" rel="nofollow">History</a> |
{%- endif %}
<a class="source-link" href="{{ make_url(path_info, 'source=view') }}" rel="nofollow">Source</a> |
{%- endif %}
......
......@@ -69,8 +69,8 @@
<h4 class="float-left">Source of: {{ source_file }}</h4>
<p class="text-right">
{% if git_info and constant('GIT_PUBLIC_URL') is defined -%}
<a href="{{ constant('GIT_PUBLIC_URL') ~ '/blob/master' ~ git_info.file }}" class="btn btn-primary" rel="nofollow">View in Git</a>
{% if git_info and git_base_url -%}
<a href="{{ make_url(git_base_url ~ '/blob/master' ~ git_info.file) }}" class="btn btn-primary" rel="nofollow">View in Git</a>
{%- endif %}
<button type="button" class="wordwrap-toggle btn btn-primary" data-toggle="button" aria-pressed="false" autocomplete="off">Word Wrap</button>
</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment