[gimp-web/gimp-web-static] Modified navigation to only list top-level pages



commit 17d957d24c2cd3336e98283ee1eccc3357a4abca
Author: Pat David <patdavid gmail com>
Date:   Wed Aug 19 14:26:44 2015 -0500

    Modified navigation to only list top-level pages

 pelicanconf.py                     |    8 ++++++--
 themes/newgimp/templates/base.html |    5 +++++
 themes/newgimp/templates/page.html |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/pelicanconf.py b/pelicanconf.py
index 1beca68..6f48660 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -42,13 +42,14 @@ RELATIVE_URLS = True
 
 # Pat David changes while building/testing
 
-# We can probably remove 'pages' if nothing ends up there
 # This will copy over these folders w/o modification
 STATIC_PATHS = ['images', 'pages', 'tutorials', 'about', 'books', 'develop', 'docs', 'donating', 
'downloads', 'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix']
 
-
+# This sets which directories will be parsed as pages (vs. news/articles)
 PAGE_PATHS = ['about', 'pages', 'tutorials', 'books', 'develop', 'docs', 'donating', 'downloads', 
'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix']
 
+ARTICLE_PATHS = ['news']
+
 THEME = "./themes/newgimp"
 
 # Trying to properly nest sub-folders here
@@ -73,6 +74,9 @@ ARTICLE_SAVE_AS = "news/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html"
 # This redirects the old standard output of blog/news/articles post
 # summaries on the front page.  It will now appear at the location
 # below instead.
+# The _actual_ index.html page is located at:
+# content/pages/index.md -> which simply calls the home.html template
+# See: http://docs.getpelican.com/en/3.6.3/faq.html#how-can-i-use-a-static-page-as-my-home-page
 INDEX_SAVE_AS = "/news/index.html"
 
 TYPOGRIFY = True
diff --git a/themes/newgimp/templates/base.html b/themes/newgimp/templates/base.html
index 12f1275..eb27379 100644
--- a/themes/newgimp/templates/base.html
+++ b/themes/newgimp/templates/base.html
@@ -80,9 +80,14 @@
             {% endfor %}
             {% if DISPLAY_PAGES_ON_MENU %}
               {% for p in PAGES %}
+                {% if p.parents|length == 1 %}
+                  <li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ 
p.title }}</a></li>
+                {% endif %}
+                {# The old way...
                   {% if not p.parent %}
                     <li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ 
p.title }}</a></li>
                   {% endif %}
+                #}
               {% endfor %}
             {% else %}
               {% if DISPLAY_CATEGORIES_ON_MENU %}
diff --git a/themes/newgimp/templates/page.html b/themes/newgimp/templates/page.html
index aa5bc7e..b5468b5 100644
--- a/themes/newgimp/templates/page.html
+++ b/themes/newgimp/templates/page.html
@@ -55,6 +55,7 @@
         
             <p>page parents</p>
         <ul>
+            <li>page.parents.length: {{ page.parents|length }}</li>
             {% for parent in page.parents %}
             <li>url: {{ parent.url }} - title: {{ parent.title }}<br/>
                 <a href="{{ SITEURL }}/{{ parent.url }}">{{ parent.title }}</a></li>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]