Skip to content

Commit bdce0d6

Browse files
committed
Add a edit on github link
1 parent afb6387 commit bdce0d6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

templates/base.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@
147147
{%- endfor %}
148148
</nav>
149149
{%- endif %}
150+
151+
{#- Github edit page link #}
152+
{%- if section -%}
153+
{%- set relative_path = section.relative_path -%}
154+
{%- endif -%}
155+
{%- if page -%}
156+
{%- set relative_path = page.relative_path -%}
157+
{%- endif -%}
158+
{%- if relative_path -%}
159+
<a href="https://github.com/c-git/c-git.github.io/edit/main/content/{{ relative_path }}" target="_blank">{{ macros::translate(key="Edit this page on GitHub", default="Edit this page on GitHub", i18n=i18n) }}</a>
160+
{%- endif %}
150161

151162
{#- Copyright START #}
152163
{%- if config.extra.copyright | default(value=true) -%}

0 commit comments

Comments
 (0)