article.html 4.3 KB

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