Skip to content

Commit

Permalink
#1173: improve navigation through guides (#1286)
Browse files Browse the repository at this point in the history
* 1173: improve navigation through guides.

* #1173: fix previous/next for de/it locales.
  • Loading branch information
romanshoryn authored and fhemberger committed Jul 12, 2017
1 parent 45a3aac commit cb71851
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 2 deletions.
3 changes: 1 addition & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ function buildLocale (source, locale) {
refer: false
},
guides: {
pattern: 'docs/guides/!(index).md',
refer: false
pattern: 'docs/guides/!(index).md'
}
}))
.use(pagination({
Expand Down
8 changes: 8 additions & 0 deletions layouts/css/page-modules/_prev-next-navigation.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.btn-navigation
padding .1em .5em

&.btn-prev
float left

&.btn-next
float right
1 change: 1 addition & 0 deletions layouts/css/styles.styl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@import 'page-modules/_events'
@import 'page-modules/_scrollToTop'
@import 'page-modules/_anchorLinks'
@import 'page-modules/_prev-next-navigation'

.intro
margin-top 140px
Expand Down
2 changes: 2 additions & 0 deletions layouts/docs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<article>
{{{ contents }}}

{{> prev-next-navigation }}
</article>

</div>
Expand Down
11 changes: 11 additions & 0 deletions layouts/partials/prev-next-navigation.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{#if previous }}
<a class="btn-navigation btn-prev" href="/{{ site.locale }}/{{ previous.path }}/">
&#9668; {{ site.previous }}
</a>
{{/if}}

{{#if next }}
<a class="btn-navigation btn-next" href="/{{ site.locale }}/{{ next.path }}/">
{{ site.next }} &#9658;
</a>
{{/if}}
2 changes: 2 additions & 0 deletions locale/ca/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"all-downloads": "Totes les opcions de descàrrega",
"nightly": "Versions Nightly",
"chakracore-nightly": "Versions Node-ChakraCore Nightly",
"previous": "Précédent",
"next": "Prochain",
"feeds": [{
"link": "feed/blog.xml",
"text": "Node.js Blog"
Expand Down
2 changes: 2 additions & 0 deletions locale/de/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"by": "von",
"all-downloads": "Alle Download-Optionen",
"nightly": "Nightly Builds",
"previous": "Zurück",
"next": "Weiter",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/en/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"all-downloads": "All download options",
"nightly": "Nightly builds",
"chakracore-nightly": "Node-ChakraCore Nightly builds",
"previous": "Previous",
"next": "Next",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/es/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"by": "por",
"all-downloads": "Todas las opciones de descarga",
"nightly": "Versiones nightly",
"previous": "Anterior",
"next": "Siguiente",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/gl/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"all-downloads": "Todas as opcións de descarga",
"nightly": "Versións Nightly",
"chakracore-nightly": "Versións Node-ChakraCore Nightly",
"previous": "Anterior",
"next": "Seguinte",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/it/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"by": "da",
"all-downloads": "Tutti i download",
"nightly": "Build notturne",
"previous": "Precedente",
"next": "Successiva",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/ja/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"by": "by",
"all-downloads": "All download options",
"nightly": "Nightly builds",
"previous": "",
"next": "",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/ko/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"all-downloads": "모든 다운로드 보기",
"nightly": "나이틀리 빌드",
"chakracore-nightly": "Node-ChakraCore 나이틀리 빌드",
"previous": "너무 이른",
"next": "다음 것",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/uk/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"by": "від",
"all-downloads": "Всі варіанти завантажень",
"nightly": "Нічні збірки",
"previous": "Попередній",
"next": "Далі",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down
2 changes: 2 additions & 0 deletions locale/zh-cn/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"by": "",
"all-downloads": "所有下载选项",
"nightly": "每日构建",
"previous": "以前",
"next": "下一個",
"feeds": [
{
"link": "feed/blog.xml",
Expand Down

0 comments on commit cb71851

Please sign in to comment.