Skip to content

Commit

Permalink
Include tag/category links on wiki pages
Browse files Browse the repository at this point in the history
e.g. Pages with the 'Cookbook' tag should have a link to
http://biopython.org/wiki/Category%3ACookbook

Note we have to replace spaces in the tags with underscores
so that e.g. 'Wiki Documentation' will link to the URL
http://peterjc.github.io/wiki/Category%3AWiki_Documentation

This is provisionally done as a bullet list above the page
title, and would benefit from some CSS styling, but is enough
to close #104.

Thank you to @Gasta88 for finding a related example which was
very helpful: http://charliepark.org/tags-in-jekyll/
  • Loading branch information
peterjc committed Feb 7, 2017
1 parent 70b51fe commit 431d351
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _layouts/wiki.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
---

<div class="page">
<ul class="tag_list_in_post">
{% for tag in page.tags %}<li class="inline tag_list_item"><a class="tag_list_link" href="/wiki/Category%3A{{ tag | replace:' ','_' }}">{{ tag }}</a></li>{% endfor %}
</ul>
<h1 class="page-title">{{ page.title }}</h1>
{{ content }}
</div>

0 comments on commit 431d351

Please sign in to comment.