[reproducible-website] 02/02: Support draft posts.

Chris Lamb chris at chris-lamb.co.uk
Sun Apr 22 12:55:17 CEST 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository reproducible-website.

commit adddc1213796976b62ef48524d51b6384f9450b4
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Apr 22 12:55:04 2018 +0200

    Support draft posts.
---
 _layouts/blog.html | 9 ++++++++-
 blog.html          | 2 +-
 blog/index.rss     | 4 +++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/_layouts/blog.html b/_layouts/blog.html
index 2300485..f982f1f 100644
--- a/_layouts/blog.html
+++ b/_layouts/blog.html
@@ -6,7 +6,14 @@ layout: default
 
 <header class="post-header">
   <h1>Reproducible Builds: Weekly report #{{ page.week }}</h1>
-  <p>Posted: {{ page.date | date: "%b %-d, %Y" }}</p>
+  {% if page.published %}
+    <p>Published: {{ page.published | date: "%b %-d, %Y" }}</p>
+  {% else %}
+    <hr><center><strong>
+      This is an unpublished draft post.<br>
+      <a href="https://anonscm.debian.org/git/reproducible/reproducible-website.git/tree/_blog/posts/{{ page.week }}.md">(source)</a>
+    </strong></center><br>
+  {% endif %}
 </header>
 
 <hr>
diff --git a/blog.html b/blog.html
index b12bb65..c578707 100644
--- a/blog.html
+++ b/blog.html
@@ -13,7 +13,7 @@ order: -1
 
 <ul>
 {% for page in by_week %}
-{% if page.date %}
+{% if page.published %}
   <li>
     <a href="/blog/posts/{{ page.week }}/">Week {{ page.week }}</a>
   </li>
diff --git a/blog/index.rss b/blog/index.rss
index d5b785f..9161cb5 100644
--- a/blog/index.rss
+++ b/blog/index.rss
@@ -14,13 +14,15 @@ layout: none
 
     {% assign sorted = site.blog | sort: 'date' | reverse %}
     {% for page in sorted limit:10 %}
+    {% if page.published %}
       <item>
         <title>Reproducible Builds: Weekly report #{{ page.week }}</title>
-        <pubDate>{{ page.date | date_to_rfc822 }}</pubDate>
+        <pubDate>{{ page.published | date_to_rfc822 }}</pubDate>
         <link>{{ page.url | prepend: site.url }}</link>
         <guid isPermaLink="true">{{ page.url | prepend: site.url }}</guid>
         <description>{{ page.content | xml_escape }}</description>
       </item>
+    {% endif %}
     {% endfor %}
 
   </channel>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reproducible-website.git


More information about the rb-commits mailing list