Merge pull request #193 from goanpeca/enh/edit-link

PR: Add edit on github link for all pages
This commit is contained in:
Russell Keith-Magee 2017-09-26 07:01:17 +08:00 committed by GitHub
commit 310f9333cd
2 changed files with 14 additions and 1 deletions

View file

@ -1,7 +1,8 @@
[en]
; Breadcrumbs
home = Home
edit_on_github = Edit on GitHub
; Footer
sitemap = Sitemap
@ -116,6 +117,7 @@ incomplete_space_before_link = false
[es]
; Breadcrumbs
home = Inicio
edit_on_github = Editar en GitHub
; Footer
sitemap = Mapa del Sitio

View file

@ -12,6 +12,7 @@
{% set t_languages = transbag('menu', this.alt, 'languages') %}
{% set t_sitemap = transbag('translate', this.alt, 'sitemap') %}
{% set t_welcome = transbag('translate', this.alt, 'welcome') %}
{% set t_edit_on_github = transbag('translate', this.alt, 'edit_on_github') %}
<!DOCTYPE html>
<html lang="en">
@ -83,6 +84,16 @@ ga('send', 'pageview');
</div>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
{% set extra_slash = '/' if this.path[-1] != '/' else '' %}
{% set alt_path = '+' + this.alt if this.alt and this.alt != 'en' else '' %}
{# set trans_available = this.contents != site.get(this.path).contents.as_text() #}
<li class="small">
<a href="https://github.com/pybee/pybee.github.io/edit/lektor/content{{ this.path }}{{ extra_slash }}contents{{ alt_path }}.lr">
<i class="fa fa-github "></i><small>{{ t_edit_on_github }}</small>
</a>
</li>
</ul>
</div>
</nav>