Skip to content

Commit

Permalink
Add featured stories to index
Browse files Browse the repository at this point in the history
Close #12
  • Loading branch information
shaunagm committed Jun 4, 2014
1 parent ef46953 commit 2324579
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion content/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Title: Reviving debexpo
Date: 2014-05-30 0:13:57
Author: Asheesh Laroia
Slug: reviving-debexpo
Tags: project - debian, difficulties encountered - build, helped by - IRC, helped by - web search, kind of contribution - code, kind of contribution - community mangement
Tags: project - debian, difficulties encountered - build, helped by - IRC, helped by - web search, kind of contribution - code, kind of contribution - community mangement, featured

I discovered, through reading the Debian wiki, that there was a new web app created for Debian called Debexpo, and it was nearly ready to replace our existing package review tool, but not quite ready.

Expand Down
5 changes: 3 additions & 2 deletions content/test1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Title: First Test Post
Title: Featured Test Post
Date: 2014-05-24 12:00
Tags: kind of contribution - code, kind of contribution - documentation, helped by - computer club, difficulties encountered - build, difficulties encountered - mistake in documentation, difficulties encountered - language barrier, project - openhatch
Tags: kind of contribution - code, kind of contribution - documentation, helped by - computer club, difficulties encountered - build, difficulties encountered - mistake in documentation, difficulties encountered - language barrier, project - openhatch, featured

This is a great post that is why we are featuring it.
32 changes: 32 additions & 0 deletions themes/pelican-elegant/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,38 @@ <h1>Tags</h1>
</div>
</div>

{% if page_name == 'index' %}

{% for tag, articles in tags|sort %}
{% if tag == 'featured' %}

<div class="row-fluid">
<div class="{{css_class}}">
<header>
<h1 id="recent-posts">Featured Posts <a id="allposts" href="{{ SITEURL }}/archives.html">all posts</a></h1>
</header>
<div class="recent-posts">

{% for article in articles %}
<article>
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} {%if article.subtitle %} <small> {{ article.subtitle }} </small> {% endif %} </a>
<section>
posted in
<a href="{{ SITEURL }}/categories.html#{{ article.category.slug }}-ref">{{ article.category }}</a>
<div class="recent-posts-time">
<time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
</div>
</section>
</article>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% endfor %}

{% endif %}

<div class="row-fluid">
<div class="{{css_class}}">
<header>
Expand Down

0 comments on commit 2324579

Please sign in to comment.