Skip to content

Commit

Permalink
Added edit link (fix #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Feb 5, 2018
1 parent f5ff0c1 commit bc1bb06
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ description: >
twitter_username: etalab
github_username: etalab

github_repository: etalab/doc.data.gouv.fr

lang: fr

i18n:
en:
edit: Edit this page
fr:
edit: Editer cette page

sass:
style: compressed

Expand Down
10 changes: 10 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
---

{% include hero.html %}
{% assign lang = page.lang | default: site.lang | default: "en" %}
<div class="documentation">
{% include sidebar.html %}
<div class="main-pane">
<div class="markdown">{{ content }}</div>
{% comment %}
Use the github edit link until netlify-cms support easy deep link.
See: https://github.com/netlify/netlify-cms/issues/697
{% endcomment %}
<p class="text-center">
<a class="edit-button" href="https://github.com/{{ site.github_repository }}/edit/master/{{ page.path }}">
✎ {{ site.i18n[lang].edit }}
</a>
</p>
</div>
</div>
9 changes: 9 additions & 0 deletions _sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,12 @@
.page .categories__item {
margin: 1em 0;
}

.text-center {
text-align: center;
}

.edit-button {
padding: 5px 10px;
border: 1px solid #0081d5;
}

0 comments on commit bc1bb06

Please sign in to comment.