The code behind my Jekyll-powered blog.

index.html 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ---
  2. layout: post-index
  3. title: "Aleksandar Todorović (r3bl)"
  4. description: "Hacker. Blogger. infosec enthusiast. Free culture and open source advocate. Ford-Mozilla Open Web fellow. Previously OCCRP tech associate."
  5. tags: [hacking, infosec, AI, open source, open culture]
  6. comments: false
  7. ---
  8. {% for post in paginator.posts %}
  9. <article class="hentry">
  10. <header>
  11. <div class="entry-meta">
  12. <span class="entry-date date published updated"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time></span><span class="author v-card"><span class="fn">{{ site.owner.name }}</span></span>
  13. {% if site.reading_time %}
  14. <span class="entry-reading-time">
  15. <i class="fa fa-clock-o"></i>
  16. {% assign readtime = post.content | number_of_words | divided_by:site.words_per_minute %}
  17. Reading time ~{% if readtime <= 1 %}1 minute{% else %}{{ readtime }} minutes{% endif %}
  18. </span><!-- /.entry-reading-time -->
  19. {% endif %}
  20. </div><!-- /.entry-meta -->
  21. {% if post.link %}
  22. <h1 class="entry-title"><a href="{{ site.url }}{{ post.url }}" class="permalink" rel="bookmark" title="{{ post.title }}"><i class="fa fa-bookmark"></i></a>{{ post.title }}</h1>
  23. {% else %}
  24. <h1 class="entry-title"><a href="{{ site.url }}{{ post.url }}" rel="bookmark" title="{{ post.title }}" itemprop="url">{{ post.title }}</a></h1>
  25. {% endif %}
  26. </header>
  27. {% assign images = post.content | split:"<img" %}
  28. {% for image in images %}
  29. {% if image contains 'src=' %}
  30. {% assign imageMarkup = image | split:">" | first %}
  31. <a href="{{ site.url }}{{ post.url }}"><img {{ imageMarkup }}></a>
  32. {% break %}
  33. {% endif %}
  34. {% endfor %}
  35. <div class="entry-content">
  36. <a href="{{ site.url }}{{ post.url }}">
  37. {% if post.content contains "<!-- more -->" %}
  38. {{ post.content | split:"<!-- more -->" | first }}
  39. {% else %}
  40. {{ post.content | strip_html | truncatewords: 50 }}
  41. {% endif %}
  42. </a>
  43. </div><!-- /.entry-content -->
  44. </a>
  45. </article><!-- /.hentry -->
  46. {% endfor %}
  47. <div class="pagination">
  48. {% if paginator.previous_page %}
  49. {% if paginator.previous_page == 1 %}
  50. <a href="{{ site.url }}" class="btn">Previous</a>
  51. {% else %}
  52. <a href="{{ site.url }}/page/{{ paginator.previous_page }}" class="btn">Previous</a>
  53. {% endif %}
  54. {% else %}
  55. Previous
  56. {% endif %}
  57. <ul class="inline-list">
  58. <li>
  59. {% if paginator.page == 1 %}
  60. <span class="current-page">1</span>
  61. {% else %}
  62. <a href="{{ site.url }}">1</a>
  63. {% endif %}
  64. </li>
  65. {% for count in (2..paginator.total_pages) %}
  66. <li>
  67. {% if count == paginator.page %}
  68. <span class="current-page">{{ count }}</span>
  69. {% else %}
  70. <a href="{{ site.url }}/page/{{ count }}">{{ count }}</a>
  71. {% endif %}
  72. </li>
  73. {% endfor %}
  74. </ul>
  75. {% if paginator.next_page %}
  76. <a href="{{ site.url }}/page/{{ paginator.next_page }}" class="btn">Next</a>
  77. {% else %}
  78. Next
  79. {% endif %}
  80. </div><!-- /.pagination -->