article.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. {% if DISQUS_SITENAME and SITEURL and article.status != "draft" %}
  47. <section>
  48. {% if ELEGANT_COMMENT_MESSAGE %}
  49. <hr/>
  50. <p id="comment-message">{{ ELEGANT_COMMENT_MESSAGE }} </p>
  51. {% endif %}
  52. <div class="accordion" id="accordion2">
  53. <div class="accordion-group">
  54. <div class="accordion-heading">
  55. <a class="accordion-toggle disqus-comment-count" data-toggle="collapse" data-parent="#accordion2" href="http://hackercodex.com/guide/install-fish-shell-mac-ubuntu/#disqus_thread">
  56. Comments
  57. </a>
  58. </div>
  59. <div id="disqus_thread" class="accordion-body collapse">
  60. <div class="accordion-inner">
  61. <div class="comments">
  62. {% include 'disqus_script_comment.html' %}
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </section>
  69. {% endif %}
  70. </div>
  71. <section>
  72. <div class="span2" style="float:right">
  73. {% if article.date %}
  74. <h4>Published</h4>
  75. {% set day = article.date.strftime('%d')|int %}
  76. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  77. {% endif %}
  78. {% if article.modified %}
  79. <h4>Last Updated</h4>
  80. {{ article.modified }}
  81. {% endif %}
  82. {% if article.category %}
  83. <h4>Category</h4>
  84. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  85. {% endif %}
  86. {% if article.tags %}
  87. <h4>Tags</h4>
  88. <ul class="list-of-tags tags-in-article">
  89. {% for tag in article.tags %}
  90. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  91. {% for aTag, tagged_articles in tags if aTag == tag %}
  92. <span>{{ tagged_articles|count }}</span>
  93. {% endfor %}</a></li>
  94. {% endfor %}
  95. </ul>
  96. {% endif %}
  97. </div>
  98. </section>
  99. </div>
  100. </article>
  101. <script type="text/javascript" language="JavaScript">
  102. moveTOC();
  103. </script>
  104. {% endblock content %}
  105. {% block script %}
  106. {% include 'disqus_script_count.html' %}
  107. {% endblock script %}