article.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <article>
  15. <div class="row-fluid">
  16. <header class="page_header span12">
  17. <h1><a href="/{{ article.url }}"> {{ article.title }} {%if article.subtext %} <small> {{ article.subtext }} </small> {% endif %} </a></h1>
  18. </header>
  19. </div>
  20. <div class="row-fluid">
  21. <div class="span8 offset1 article-content">
  22. {{ article.content }}
  23. </div>
  24. <section>
  25. <div class="span2 offset1">
  26. {% if article.date %}
  27. <h4>Published</h4>
  28. {% set day = article.date.strftime('%d')|int %}
  29. <time pubdate="pubdate" datetime="{{ article.date }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  30. {% endif %}
  31. {% if article.modified %}
  32. <h4>Last Updated</h4>
  33. {{ article.modified }}
  34. {% endif %}
  35. {% if article.category %}
  36. <h4>Category</h4>
  37. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  38. {% endif %}
  39. {% if article.tags %}
  40. <h4>Tags</h4>
  41. <ul class="list-of-tags tags-in-article">
  42. {% for tag in article.tags %}
  43. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  44. {% for aTag, tagged_articles in tags if aTag == tag %}
  45. <span>{{ tagged_articles|count }}</span>
  46. {% endfor %}</a></li>
  47. {% endfor %}
  48. </ul>
  49. {% endif %}
  50. </div>
  51. </section>
  52. </div>
  53. <article>
  54. <script type="text/javascript" language="JavaScript">
  55. moveTOC();
  56. </script>
  57. {% endblock content %}