article.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 span10 offset2">
  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 offset2 article-content">
  22. {{ article.content }}
  23. <aside>
  24. {% for an_artcile in dates %}
  25. {% if an_artcile.url == article.url %}
  26. {% set index = loop.index0 %}
  27. {% if not loop.first %}
  28. {% set next_article = dates[index-1] %}
  29. {% endif %}
  30. {% if not loop.last %}
  31. {% set previous_article = dates[index+1] %}
  32. {% endif %}
  33. <nav>
  34. <ul class="articles_timeline">
  35. {% if previous_article %}
  36. <li class="previous_article">« <a href="/{{ previous_article.url }}" title="Previous: {{ previous_article.title }}">{{ previous_article.title }}</a></li>
  37. {% endif %}
  38. {% if next_article %}
  39. <li class="next_article"><a href="/{{ next_article.url }}" title="Next: {{ next_article.title }}">{{ next_article.title }}</a> »</li>
  40. {% endif %}
  41. </ul>
  42. </nav>
  43. {% endif %}
  44. {% endfor %}
  45. </aside>
  46. </div>
  47. <section>
  48. <div class="span2" style="float:right">
  49. {% if article.date %}
  50. <h4>Published</h4>
  51. {% set day = article.date.strftime('%d')|int %}
  52. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  53. {% endif %}
  54. {% if article.modified %}
  55. <h4>Last Updated</h4>
  56. {{ article.modified }}
  57. {% endif %}
  58. {% if article.category %}
  59. <h4>Category</h4>
  60. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  61. {% endif %}
  62. {% if article.tags %}
  63. <h4>Tags</h4>
  64. <ul class="list-of-tags tags-in-article">
  65. {% for tag in article.tags %}
  66. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  67. {% for aTag, tagged_articles in tags if aTag == tag %}
  68. <span>{{ tagged_articles|count }}</span>
  69. {% endfor %}</a></li>
  70. {% endfor %}
  71. </ul>
  72. {% endif %}
  73. </div>
  74. </section>
  75. </div>
  76. <article>
  77. <script type="text/javascript" language="JavaScript">
  78. moveTOC();
  79. </script>
  80. {% endblock content %}