[gimp-web/gimp-web-static] Modified default behavior to have news articles appear on a different page



commit dcb5bb8c2f201696cb4a39cf6fbaba5ae1704463
Author: Pat David <patdavid gmail com>
Date:   Wed Aug 19 12:12:38 2015 -0500

    Modified default behavior to have news articles appear on a different page
    
    http://docs.getpelican.com/en/3.6.3/faq.html#how-can-i-use-a-static-page-as-my-home-page
    Details the steps to set a static index.html page for the site, while
    redirecting standard article listing behavior to a new location

 content/pages/index.md                  |    7 ++
 pelicanconf.py                          |   14 +++-
 themes/newgimp/templates/home.html      |  133 +++++++++++++++++++++++++
 themes/newgimp/templates/index.html.bak |  160 +++++++++++++++++++++++++++++++
 4 files changed, 313 insertions(+), 1 deletions(-)
---
diff --git a/content/pages/index.md b/content/pages/index.md
new file mode 100644
index 0000000..518cf0c
--- /dev/null
+++ b/content/pages/index.md
@@ -0,0 +1,7 @@
+Title: GIMP
+Date: 2015-08-19T11:43:22-05:00
+URL:
+save_as: index.html
+Template: home
+
+Test.
diff --git a/pelicanconf.py b/pelicanconf.py
index d6f0c57..1beca68 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -47,7 +47,7 @@ RELATIVE_URLS = True
 STATIC_PATHS = ['images', 'pages', 'tutorials', 'about', 'books', 'develop', 'docs', 'donating', 
'downloads', 'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix']
 
 
-PAGE_PATHS = ['about', 'tutorials', 'books', 'develop', 'docs', 'donating', 'downloads', 'features', 'bugs', 
'links', 'man', 'release-notes', 'screenshots', 'source', 'unix']
+PAGE_PATHS = ['about', 'pages', 'tutorials', 'books', 'develop', 'docs', 'donating', 'downloads', 
'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix']
 
 THEME = "./themes/newgimp"
 
@@ -70,9 +70,21 @@ PAGE_SAVE_AS = "{slug}/{filename}"
 ARTICLE_URL = "news/{date:%Y}/{date:%m}/{date:%d}/{slug}/"
 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.
+INDEX_SAVE_AS = "/news/index.html"
+
 TYPOGRIFY = True
 TYPOGRIFY_IGNORE_TAGS = ['title']
 
 DELETE_OUTPUT_DIRECTORY = True
 
 MD_EXTENSIONS = ['fenced_code', 'codehilite(css_class=codehilite)', 'extra', 'headerid', 'toc']
+
+
+# Pagination testing stuff
+
+DEFAULT_ORPHANS = 0
+DEFAULT_PAGINATION = 5
+
diff --git a/themes/newgimp/templates/home.html b/themes/newgimp/templates/home.html
new file mode 100644
index 0000000..4d6dcdb
--- /dev/null
+++ b/themes/newgimp/templates/home.html
@@ -0,0 +1,133 @@
+{% extends "base.html" %}
+
+{% block head %}
+{{ super() }}
+<link rel='stylesheet' type='text/css' href="{{ SITEURL }}/theme/css/index.css" />
+{% endblock head %}
+
+
+{% block header %}
+<header id="banner" class="body clearfix">
+            <div class="container">
+                <div class="intro row">
+
+                    <img id='WilberLogo' src="{{ SITEURL }}/theme/images/wilber-big.png" alt="GIMP Wilber" 
width='200' height='150'/>
+                    <h1>
+                        <a href="{{ SITEURL }}/">GIMP</a>
+                        {#<a href="{{ SITEURL }}/">{{ SITENAME }} <strong>{{ SITESUBTITLE }}</strong></a> #}
+                        {# <a href="{{ SITEURL }}/"><img src="{{ SITEURL }}/theme/images/wilber-big.png" 
alt="GIMP Wilber"/>{{ SITENAME }}</a> #}
+                    </h1>
+                    <div class='introInfo'>
+                        <span id='gFirst'>GNU IMAGE (EEK)</span>
+                        <span id='gSecond'>MANIPULATION PROGRAM</span>
+                        <span id='gThird'>
+                            <a href="/downloads/">
+                                <span id="DLButton"><i class="fa fa-download"></i> DOWNLOAD</span>
+                            </a>
+                            <span id="ReleaseButton">RELEASE NOTES</span></span>
+                    </div>
+                </div>
+            </div>
+        </header><!-- /#banner -->
+
+{% endblock header %}
+
+    
+{% block content %}
+
+    <section id='introduction'>
+        <div class='container'>
+            <div class='row clearfix'>
+                <div class='column two-thirds'>
+                    <h2>The Free &amp; Open Source Image Editor</h2>
+                    {# <h2>This is the official GIMP website</h2> #}
+                    <p>
+                        This is the official GIMP website.
+                        It contains information about downloading, installing, using, and enhancing it. 
+                        This site also serves as a distribution point for the latest releases. 
+                        We try to provide as much information about the GIMP community and related projects 
as possible.
+                        Hopefully you will find what you need here.
+                        Grab a properly chilled beverage and enjoy...
+                    </p>
+                    <p>
+                        <b>I feel that this section should tell a visitor exactly <em>what</em> GIMP is, 
what it does, as well as how to get it.</b>
+                    </p>
+                </div>
+
+                <div class='column third' style="background-color: white; margin-left: 10px; margin-right: 
-10px; padding: 1rem; box-shadow: rgba(127,127,127,1) 2px 2px, rgba(127,127,127,1) 3px 3px, 
rgba(127,127,127,1) 4px 4px, rgba(127,127,127,1) 5px 5px, rgba(127,127,127,1) 6px 6px;">
+                    <h2 style="color: red;">STILL WORKING</h2>
+                    <p style='font-size: 0.85rem;color: red;'>
+                        I am still in the process of building this site out.  Things are in a great state of 
flux.  For further information on building the new site refer to the <a href="/about/meta">Meta</a> page.
+                    </p>
+                </div>
+
+
+            </div>
+        </div>
+    </section>
+
+    <section id='cap-photos'>
+        <div class='container'>
+            <div class='row clearfix'>
+                <div class='column third'>
+                    &nbsp;
+                </div>
+                <div class='column two-thirds'>
+                    <h3>High Quality Photo Manipulation</h3>
+                    <p>
+                        GIMP provides the tools for needed for high quality image manipulation.
+                        From retouching to creative composites, the only limit is your imagination.
+                    </p>
+                </div>
+            </div>
+        </div>
+    </section>
+
+
+    <section style='background: repeating-linear-gradient(-45deg, transparent, transparent 40px, 
rgba(166,166,166,.07) 40px, rgba(166,166,166,.07) 80px);'>
+        <div class='container'>
+            <div class='row clearfix'>
+                <div class='column full'>
+                    <h2>Temporary Stuff Below Here</h2>
+                    <p>
+                        The content below this section is almost entirely for testing the build system and 
article parsing.
+                        Disregard the formatting/content unless specifically addressing something that was 
asked about.
+                        (Like, do those dates look funny to you?)
+                    </p>
+                </div>
+            </div>
+        </div>
+    </section>
+
+    <section id="articles">
+        {#
+        {% block content_title %}
+            <h2>Recent News</h2>
+        {% endblock %}
+
+        
+        {# original stuff ...
+        <ol id="post-list">
+        {% for article in articles_page.object_list %}
+                <li><article class="hentry">
+                        <header> <h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" 
rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2> </header>
+                        <footer class="post-info">
+                            <abbr class="published" title="{{ article.date.isoformat() }}"> {{ 
article.locale_date }} </abbr>
+                            <address class="vcard author">By
+                            {% for author in article.authors %}
+                                <a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
+                            {% endfor %}
+                            </address>
+                        </footer><!-- /.post-info -->
+                        <div class="entry-content"> {{ article.summary }} </div><!-- /.entry-content -->
+                </article></li>
+        {% endfor %}
+        </ol><!-- /#posts-list -->
+        {% if articles_page.has_other_pages() %}
+            {% include 'pagination.html' %}
+        {% endif %}
+        #}
+
+    </section><!-- /#content -->
+
+{% endblock content %}
diff --git a/themes/newgimp/templates/index.html.bak b/themes/newgimp/templates/index.html.bak
new file mode 100644
index 0000000..c1feee3
--- /dev/null
+++ b/themes/newgimp/templates/index.html.bak
@@ -0,0 +1,160 @@
+{% extends "base.html" %}
+
+{% block head %}
+{{ super() }}
+<link rel='stylesheet' type='text/css' href="{{ SITEURL }}/theme/css/index.css" />
+{% endblock head %}
+
+
+{% block header %}
+<header id="banner" class="body clearfix">
+            <div class="container">
+                <div class="intro row">
+
+                    <img id='WilberLogo' src="{{ SITEURL }}/theme/images/wilber-big.png" alt="GIMP Wilber" 
width='200' height='150'/>
+                    <h1>
+                        <a href="{{ SITEURL }}/">GIMP</a>
+                        {#<a href="{{ SITEURL }}/">{{ SITENAME }} <strong>{{ SITESUBTITLE }}</strong></a> #}
+                        {# <a href="{{ SITEURL }}/"><img src="{{ SITEURL }}/theme/images/wilber-big.png" 
alt="GIMP Wilber"/>{{ SITENAME }}</a> #}
+                    </h1>
+                    <div class='introInfo'>
+                        <span id='gFirst'>GNU IMAGE</span>
+                        <span id='gSecond'>MANIPULATION PROGRAM</span>
+                        <span id='gThird'>
+                            <a href="/downloads/">
+                                <span id="DLButton"><i class="fa fa-download"></i> DOWNLOAD</span>
+                            </a>
+                            <span id="ReleaseButton">RELEASE NOTES</span></span>
+                    </div>
+                </div>
+            </div>
+        </header><!-- /#banner -->
+
+{% endblock header %}
+
+    
+{% block content %}
+
+    <section id='introduction'>
+        <div class='container'>
+            <div class='row clearfix'>
+                <div class='column two-thirds'>
+                    <h2>The Free &amp; Open Source Image Editor</h2>
+                    {# <h2>This is the official GIMP website</h2> #}
+                    <p>
+                        This is the official GIMP website.
+                        It contains information about downloading, installing, using, and enhancing it. 
+                        This site also serves as a distribution point for the latest releases. 
+                        We try to provide as much information about the GIMP community and related projects 
as possible.
+                        Hopefully you will find what you need here.
+                        Grab a properly chilled beverage and enjoy...
+                    </p>
+                    <p>
+                        <b>I feel that this section should tell a visitor exactly <em>what</em> GIMP is, 
what it does, as well as how to get it.</b>
+                    </p>
+                </div>
+
+                <div class='column third' style="background-color: white; margin-left: 10px; margin-right: 
-10px; padding: 1rem; box-shadow: rgba(127,127,127,1) 2px 2px, rgba(127,127,127,1) 3px 3px, 
rgba(127,127,127,1) 4px 4px, rgba(127,127,127,1) 5px 5px, rgba(127,127,127,1) 6px 6px;">
+                    <h2 style="color: red;">STILL WORKING</h2>
+                    <p style='font-size: 0.85rem;color: red;'>
+                        I am still in the process of building this site out.  Things are in a great state of 
flux.  For further information on building the new site refer to the <a href="/about/meta">Meta</a> page.
+                    </p>
+                </div>
+
+
+            </div>
+        </div>
+    </section>
+
+    <section id='cap-photos'>
+        <div class='container'>
+            <div class='row clearfix'>
+                <div class='column third'>
+                    &nbsp;
+                </div>
+                <div class='column two-thirds'>
+                    <h3>High Quality Photo Manipulation</h3>
+                    <p>
+                        GIMP provides the tools for needed for high quality image manipulation.
+                        From retouching to creative composites, the only limit is your imagination.
+                    </p>
+                </div>
+            </div>
+        </div>
+    </section>
+
+
+    <section style='background: repeating-linear-gradient(-45deg, transparent, transparent 40px, 
rgba(166,166,166,.07) 40px, rgba(166,166,166,.07) 80px);'>
+        <div class='container'>
+            <div class='row clearfix'>
+                <div class='column full'>
+                    <h2>Temporary Stuff Below Here</h2>
+                    <p>
+                        The content below this section is almost entirely for testing the build system and 
article parsing.
+                        Disregard the formatting/content unless specifically addressing something that was 
asked about.
+                        (Like, do those dates look funny to you?)
+                    </p>
+                </div>
+            </div>
+        </div>
+    </section>
+
+    <section id="articles">
+        {% block content_title %}
+            <h2>Recent News</h2>
+        {% endblock %}
+
+        <div class="container">
+            {% for article in articles_page.object_list %}
+                <div class='row clearfix'>
+                    <h3 class="entry-title">
+                        <a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ 
article.title|striptags }}">
+                            {{ article.title }}
+                        </a>
+                    </h3>
+
+                    <div class='post-info'>
+                        <abbr class="published" title="{{ article.date.isoformat() }}"> {{ 
article.locale_date }} </abbr>
+                        <address class="vcard author">by
+                            {% for author in article.authors %}
+                                <a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
+                            {% endfor %}
+                        </address>
+                    </div>
+
+                    <div class='entry-content'> {{ article.summary }} </div>
+                </div>
+                <hr/>
+            {% endfor %}
+            {% if articles_page.has_other_pages() %}
+                {% include 'pagination.html' %}
+            {% endif %}
+        </div>
+
+        #}
+
+        {# original stuff ...
+        <ol id="post-list">
+        {% for article in articles_page.object_list %}
+                <li><article class="hentry">
+                        <header> <h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" 
rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2> </header>
+                        <footer class="post-info">
+                            <abbr class="published" title="{{ article.date.isoformat() }}"> {{ 
article.locale_date }} </abbr>
+                            <address class="vcard author">By
+                            {% for author in article.authors %}
+                                <a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
+                            {% endfor %}
+                            </address>
+                        </footer><!-- /.post-info -->
+                        <div class="entry-content"> {{ article.summary }} </div><!-- /.entry-content -->
+                </article></li>
+        {% endfor %}
+        </ol><!-- /#posts-list -->
+        {% if articles_page.has_other_pages() %}
+            {% include 'pagination.html' %}
+        {% endif %}
+        #}
+
+    </section><!-- /#content -->
+
+{% endblock content %}


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