article.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. {% include 'comments.html' %}
  47. </div>
  48. <section>
  49. <div class="span2" style="float:right">
  50. {% if article.date %}
  51. <h4>Published</h4>
  52. {% set day = article.date.strftime('%d')|int %}
  53. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  54. {% endif %}
  55. {% if article.modified %}
  56. <h4>Last Updated</h4>
  57. {{ article.modified }}
  58. {% endif %}
  59. {% if article.category %}
  60. <h4>Category</h4>
  61. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  62. {% endif %}
  63. {% if article.tags %}
  64. <h4>Tags</h4>
  65. <ul class="list-of-tags tags-in-article">
  66. {% for tag in article.tags %}
  67. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  68. {% for aTag, tagged_articles in tags if aTag == tag %}
  69. <span>{{ tagged_articles|count }}</span>
  70. {% endfor %}</a></li>
  71. {% endfor %}
  72. </ul>
  73. {% endif %}
  74. </div>
  75. </section>
  76. </div>
  77. </article>
  78. <script type="text/javascript" language="JavaScript">
  79. moveTOC();
  80. </script>
  81. {% endblock content %}
  82. {% block script %}
  83. {% include 'disqus_script_count.html' %}
  84. {% endblock script %}