You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/07/30 00:00:51 UTC

[3/6] allura-site git commit: [#7938] properly relative URLs; create feeds and archive pages for tags

[#7938] properly relative URLs; create feeds and archive pages for tags


Project: http://git-wip-us.apache.org/repos/asf/allura-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura-site/commit/86483cd9
Tree: http://git-wip-us.apache.org/repos/asf/allura-site/tree/86483cd9
Diff: http://git-wip-us.apache.org/repos/asf/allura-site/diff/86483cd9

Branch: refs/heads/db/7938
Commit: 86483cd9e1f66bbd92ff1b06c2cdcdaed724515f
Parents: 869d61a
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Jul 29 17:41:51 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Jul 29 17:41:51 2015 -0400

----------------------------------------------------------------------
 README.md                                     |  6 +++--
 _src/allura-theme/templates/article_list.html | 31 ++++++++++++++++++++++
 _src/allura-theme/templates/base.html         | 18 ++++++-------
 _src/allura-theme/templates/index.html        |  7 ++++-
 _src/allura-theme/templates/tag.html          | 12 +++++++++
 _src/pelicanconf.py                           | 12 +++++++++
 6 files changed, 74 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura-site/blob/86483cd9/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 0a84728..b4bd91b 100644
--- a/README.md
+++ b/README.md
@@ -10,12 +10,14 @@ Generated content is placed under root directory.
 # Working on site
 
     ~$ cd _src
+    ~$ RELATIVE=1 make regenerate  # only use RELATIVE for local dev
 
-In two separate terminal windows run the following commands:
+Then open the html files directly, or run a little server with:
 
-    ~$ make regenerate  # watch source files and regenerate site
     ~$ make serve       # serve generated site at http://localhost:8000
 
 When changes are looking good - commit them (including generated files).
 
+    ~$ make html  # for a single publish 
+
 [1]: http://blog.getpelican.com/

http://git-wip-us.apache.org/repos/asf/allura-site/blob/86483cd9/_src/allura-theme/templates/article_list.html
----------------------------------------------------------------------
diff --git a/_src/allura-theme/templates/article_list.html b/_src/allura-theme/templates/article_list.html
new file mode 100644
index 0000000..5821853
--- /dev/null
+++ b/_src/allura-theme/templates/article_list.html
@@ -0,0 +1,31 @@
+{% extends "base.html" %}
+
+{% block content %}
+<section id="content">
+
+{% block content_title %}
+<h2>All articles</h2>
+{% endblock %}
+
+<div class="row bg-white pad-vert-lg text-center">
+{% for article in articles_page.object_list %}
+  <div class="row">
+    <h3><a class="text-black" href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h3>
+  </div>
+
+  <div class="post-info">
+    Published:
+    <abbr class="published" title="{{ article.date.isoformat() }}">
+      {{ article.locale_date }}
+    </abbr>
+  </div>
+  <div class="entry-content"> {{ article.summary }} </div>
+{% endfor %}
+</div>
+
+{% if articles_page.has_other_pages() %}
+    {% include 'pagination.html' %}
+{% endif %}
+
+</section>
+{% endblock content %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura-site/blob/86483cd9/_src/allura-theme/templates/base.html
----------------------------------------------------------------------
diff --git a/_src/allura-theme/templates/base.html b/_src/allura-theme/templates/base.html
index 9233681..f1ba474 100644
--- a/_src/allura-theme/templates/base.html
+++ b/_src/allura-theme/templates/base.html
@@ -12,10 +12,10 @@
 
   <!--    Facebook Meta Info-->
   <meta property="og:url" content="{{ SITEURL }}">
-  <meta property="og:image" content="theme/img/logo-asf-apache.png">
+  <meta property="og:image" content="{{ SITEURL }}/theme/img/logo-asf-apache.png">
   <meta property="og:description" content="{{ DESCRIPTION }}">
   <meta property="og:title" content="{{ SITENAME }}">
-  <meta property="og:site_name" content="{{ SITENAME }}j">
+  <meta property="og:site_name" content="{{ SITENAME }}">
   <meta property="og:see_also" content="{{ SITEURL }}">
 
   <!--    Twitter Meta Info-->
@@ -23,15 +23,15 @@
   <meta name="twitter:url" content="{{ SITEURL }}">
   <meta name="twitter:title" content="{{ SITENAME }}">
   <meta name="twitter:description" content="{{ DESCRIPTION }}">
-  <meta name="twitter:image" content="theme/img/logo-asf-apache.png">
+  <meta name="twitter:image" content="{{ SITEURL }}/theme/img/logo-asf-apache.png">
 
   <!--    Google+ Meta Info-->
   <meta itemprop="name" content="{{ SITENAME }}">
   <meta itemprop="description" content="{{ DESCRIPTION }}">
-  <meta itemprop="image" content="theme/img/logo-asf-apache.png">
+  <meta itemprop="image" content="{{ SITEURL }}/theme/img/logo-asf-apache.png">
 
-  <link rel="stylesheet" type="text/css" href="theme/css/flex.min.css">
-  <link rel="stylesheet" type="text/css" href="theme/css/style.css">
+  <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/flex.min.css">
+  <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/style.css">
   {% endblock head %}
 </head>
 
@@ -41,7 +41,7 @@
     <div id="header" class="row {% if xxl_header %}pad-vert-xxl{% endif %}">
       <header id="login_header" class="row">
         <div class="bg-shadow pad-vert-md">
-          <span><h1 class="text-center"><a href="/">Apache <img src="theme/img/logo_white.png" width="94"> Allura<span class="tm">™</span></a></h1></span>
+          <span><h1 class="text-center"><a href="{{ SITEURL }}">Apache <img src="{{ SITEURL }}/theme/img/logo_white.png" width="94"> Allura<span class="tm">™</span></a></h1></span>
           <span></span>
           <h6 class="text-center">Open source project hosting platform</h6>
         </div>
@@ -63,8 +63,8 @@
     </div>
   </section>
 
-  <script type="application/javascript" src="theme/js/jquery-1.11.2.min.js"></script>
-  <script type="application/javascript" src="theme/js/frontend.js"></script>
+  <script type="application/javascript" src="{{ SITEURL }}/theme/js/jquery-1.11.2.min.js"></script>
+  <script type="application/javascript" src="{{ SITEURL }}/theme/js/frontend.js"></script>
   <!-- Credits
 
           Logo Design: Will Leonard

http://git-wip-us.apache.org/repos/asf/allura-site/blob/86483cd9/_src/allura-theme/templates/index.html
----------------------------------------------------------------------
diff --git a/_src/allura-theme/templates/index.html b/_src/allura-theme/templates/index.html
index dc5e847..c63b655 100644
--- a/_src/allura-theme/templates/index.html
+++ b/_src/allura-theme/templates/index.html
@@ -2,6 +2,11 @@
 
 {% set xxl_header = True %}
 
+{% block head %}
+    {{ super() }}
+    <link rel="alternate" type="application/atom+xml" href="{{ SITEURL }}/feeds/all.atom.xml" title="Atom Feed">
+{% endblock %}
+
 {% block content %}
 <div id="about" class="row bg-white pad-vert-xl">
   <div class="row">
@@ -52,7 +57,7 @@
             <h5>News</h5>
             <ul>
                 {% for art in articles[:5]%}
-                    <li><a href="{{ art.url }}">{{ art.title }}</a></li>
+                    <li><a href="{{ SITEURL }}/{{ art.url }}">{{ art.title }}</a></li>
                 {% endfor %}
             </ul>
         </div>

http://git-wip-us.apache.org/repos/asf/allura-site/blob/86483cd9/_src/allura-theme/templates/tag.html
----------------------------------------------------------------------
diff --git a/_src/allura-theme/templates/tag.html b/_src/allura-theme/templates/tag.html
new file mode 100644
index 0000000..7b720a1
--- /dev/null
+++ b/_src/allura-theme/templates/tag.html
@@ -0,0 +1,12 @@
+{% extends "article_list.html" %}
+
+{% block title %}Apache Allura : '{{ tag }}' articles{% endblock %}
+
+{% block head %}
+    {{ super() }}
+    <link rel="alternate" type="application/atom+xml" href="{{ SITEURL }}/feeds/tag.{{ tag }}.atom.xml" title="Articles tagged '{{ tag }}">
+{% endblock %}
+
+{% block content_title %}
+    <h2>Articles tagged '{{ tag }}'</h2>
+{% endblock %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura-site/blob/86483cd9/_src/pelicanconf.py
----------------------------------------------------------------------
diff --git a/_src/pelicanconf.py b/_src/pelicanconf.py
index 3706906..a0c661c 100644
--- a/_src/pelicanconf.py
+++ b/_src/pelicanconf.py
@@ -30,6 +30,18 @@ EXTRA_PATH_METADATA = {
 }
 DIRECT_TEMPLATES = ['index', '404']
 
+ARTICLE_SAVE_AS = 'posts/{date:%Y}-{slug}.html'
+ARTICLE_URL = 'posts/{date:%Y}-{slug}.html'
+# don't generate archive pages for these
+AUTHOR_SAVE_AS = ''
+CATEGORY_SAVE_AS = ''
+
+TRANSLATION_FEED_ATOM = None
+AUTHOR_FEED_ATOM = None
+AUTHOR_FEED_RSS = None
+CATEGORY_FEED_ATOM = None
+TAG_FEED_ATOM = 'feeds/tag.%s.atom.xml'
+
 CURRENT_YEAR = dt.date.today().year
 
 RELEASE_VERSION = '1.3.0'