article.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. <div class="accordion" id="accordion2">
  49. <div class="accordion-group">
  50. <div class="accordion-heading">
  51. <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
  52. Collapsible Group Item #1
  53. </a>
  54. </div>
  55. <div id="collapseOne" class="accordion-body collapse">
  56. <div class="accordion-inner">
  57. Anim pariatur cliche...
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="comments">
  63. <h2>Comments !</h2>
  64. <div id="disqus_thread"></div>
  65. <script type="text/javascript">
  66. var disqus_identifier = "guide/install-fish-shell-mac-ubuntu/";
  67. var disqus_url = "{{ SITEURL }}/{{ article.url }}";
  68. (function() {
  69. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  70. dsq.src = 'http://{{ DISQUS_SITENAME }}.disqus.com/embed.js';
  71. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  72. })();
  73. </script>
  74. </div>
  75. </section>
  76. {% endif %}
  77. </div>
  78. <section>
  79. <div class="span2" style="float:right">
  80. {% if article.date %}
  81. <h4>Published</h4>
  82. {% set day = article.date.strftime('%d')|int %}
  83. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  84. {% endif %}
  85. {% if article.modified %}
  86. <h4>Last Updated</h4>
  87. {{ article.modified }}
  88. {% endif %}
  89. {% if article.category %}
  90. <h4>Category</h4>
  91. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  92. {% endif %}
  93. {% if article.tags %}
  94. <h4>Tags</h4>
  95. <ul class="list-of-tags tags-in-article">
  96. {% for tag in article.tags %}
  97. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  98. {% for aTag, tagged_articles in tags if aTag == tag %}
  99. <span>{{ tagged_articles|count }}</span>
  100. {% endfor %}</a></li>
  101. {% endfor %}
  102. </ul>
  103. {% endif %}
  104. </div>
  105. </section>
  106. </div>
  107. </article>
  108. <script type="text/javascript" language="JavaScript">
  109. moveTOC();
  110. </script>
  111. {% endblock content %}