mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ad...@apache.org
Subject incubator-mynewt-site git commit: Put a name on TOC footer links
Date Mon, 21 Mar 2016 19:02:29 GMT
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/master 39a3ce4dc -> 561065f16


Put a name on TOC footer links


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/561065f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/561065f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/561065f1

Branch: refs/heads/master
Commit: 561065f162b30c7f9cdb1d42e25630ecbdaaf342
Parents: 39a3ce4
Author: Gavin Jefferies <gavin@runtime.io>
Authored: Mon Mar 21 11:09:27 2016 -0700
Committer: Gavin Jefferies <gavin@runtime.io>
Committed: Mon Mar 21 11:09:27 2016 -0700

----------------------------------------------------------------------
 custom-theme/next_prev_links.html | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/561065f1/custom-theme/next_prev_links.html
----------------------------------------------------------------------
diff --git a/custom-theme/next_prev_links.html b/custom-theme/next_prev_links.html
index cf408a4..6020e6d 100644
--- a/custom-theme/next_prev_links.html
+++ b/custom-theme/next_prev_links.html
@@ -1,13 +1,24 @@
 {% set skip_titles=['Events'] %}
+
+{% macro link_page_title(page) -%}
+{% if page.title == 'toc' %}{{ page.ancestors[-1].title }}{% else %}{{ page.title }}{% endif
%}
+{%- endmacro %}
+
 <ul class="nav nav-pills" style="margin-bottom: 10px">
     <li>
     {% if previous_page and previous_page.title not in skip_titles %}
-    <a href={{ previous_page.url }}><span class="fa fa-arrow-left"></span>
 Previous: {{ previous_page.title }}</a>
+    <a href={{ previous_page.url }}>
+        <span class="fa fa-arrow-left"></span>
+        Previous: {{ link_page_title(previous_page) }}
+    </a>
     {% endif %}
     </li>
     <li class="pull-right">
     {% if next_page and next_page.title not in skip_titles %}
-    <a href={{ next_page.url }}></span>Next: {{ next_page.title }}  <span
class="fa fa-arrow-right">
+    <a href={{ next_page.url }}>
+        Next: {{ link_page_title(next_page) }}
+        <span class="fa fa-arrow-right"></span>
+    </a>
     {% endif %}
     </li>
 </ul>


Mime
View raw message