Skip to content

Commit

Permalink
cleanup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ingwinlu committed Sep 5, 2014
1 parent 0ad8385 commit a3413a4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 44 deletions.
77 changes: 39 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
#sort_tags
This plugin adds `tags_sorted_article_length` to the context,
which is a list of tupels (Tag, [Articles]) that is sorted
by number of Articles first and Tag second.

##Usage:
```
{% for tag, articles in tags_sorted_by_article_length %}
```
##Example tags.html
```
<section id="tags">
<div class="panel panel-default">
<div class="panel-body">
<h1>Tags for {{ SITENAME }}</h1>
<div class="panel-group" id="accordion">
{%- for tag, articles in tags_sorted_by_article_length %}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse-{{tag.slug}}">{{ tag }} <span class="badge pull-right">{{ articles|count }}</span></a>
</h4>
</div>
<div id="collapse-{{tag.slug}}" class="panel-collapse collapse">
<div class="panel-body">
{% for article in articles %}
<p><span class="categories-timestamp"><time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time></span> <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></p>
{% endfor %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</section>
```

sort_tags
===================================
This plugin adds `tags_sorted_article_length` to the context,
which is a list of tupels (Tag, [Articles]) that is sorted
by number of Articles first and Tag second.

##Usage:
```
{% for tag, articles in tags_sorted_by_article_length %}
```
##Example tags.html
```
<section id="tags">
<div class="panel panel-default">
<div class="panel-body">
<h1>Tags for {{ SITENAME }}</h1>
<div class="panel-group" id="accordion">
{%- for tag, articles in tags_sorted_by_article_length %}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse-{{tag.slug}}">{{ tag }} <span class="badge pull-right">{{ articles|count }}</span></a>
</h4>
</div>
<div id="collapse-{{tag.slug}}" class="panel-collapse collapse">
<div class="panel-body">
{% for article in articles %}
<p><span class="categories-timestamp"><time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time></span> <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></p>
{% endfor %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</section>
```

12 changes: 6 additions & 6 deletions sort_tags.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'''
This plugin adds tags_sorted_article_length to the context,
which is a list of tupels (Tag, [Articles]) that is sorted
by number of Articles first and Tag second.
Usage:
{% for tag, articles in tags_sorted_article_length %}
sort_tags
===================================
This plugin adds tags_sorted_article_length to the context,
which is a list of tupels (Tag, [Articles]) that is sorted
by number of Articles first and Tag second.
'''

from operator import itemgetter
Expand Down

0 comments on commit a3413a4

Please sign in to comment.