article.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {% extends "base.html" %}
  2. {% block title %}
  3. {{ article.title }} - {{ super() }}
  4. {% endblock title %}
  5. {% block content %}
  6. <script language="javascript" type="text/javascript">
  7. function moveTOC() {
  8. var table_of_contents = document.getElementById('contents');
  9. var toc_sidebar = document.getElementById('toc_sidebar');
  10. if (table_of_contents && toc_sidebar)
  11. toc_sidebar.appendChild(table_of_contents);
  12. }
  13. </script>
  14. <div class="row-fluid">
  15. <header class="page_header span12">
  16. <h1><a href="/{{ article.url }}"> {{ article.title }} {%if article.subtext %} <small> {{ article.subtext }} </small> {% endif %} </a></h1>
  17. </header>
  18. </div>
  19. <div class="row-fluid">
  20. <div class="span8 offset1 article-content">
  21. {{ article.content }}
  22. </div>
  23. <div class="span2 offset1">
  24. {% if article.date %}
  25. <h4>Published</h4>
  26. {% set day = article.date.strftime('%d')|int %}
  27. <time datetime="{{ article.date }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  28. {% endif %}
  29. {% if article.modified %}
  30. <h4>Last Updated</h4>
  31. {{ article.modified }}
  32. {% endif %}
  33. {% if article.category %}
  34. <h4>Category</h4>
  35. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  36. {% endif %}
  37. {% if article.tags %}
  38. <h4>Tags</h4>
  39. <ul class="list-of-tags tags-in-article">
  40. {% for tag in article.tags %}
  41. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  42. {% for aTag, tagged_articles in tags if aTag == tag %}
  43. <span>{{ tagged_articles|count }}</span>
  44. {% endfor %}</a></li>
  45. {% endfor %}
  46. </ul>
  47. {% endif %}
  48. </div>
  49. </div>
  50. <script type="text/javascript" language="JavaScript">
  51. moveTOC();
  52. </script>
  53. {% endblock content %}