Skip to content

Commit

Permalink
Merge pull request #95 from odcambc/tags
Browse files Browse the repository at this point in the history
Adds tags to posts
  • Loading branch information
odcambc authored Jun 3, 2023
2 parents 2d96c1e + b37d05f commit 7e66b0a
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions news/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,44 @@
group: news
---


<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
<hr>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p class="author">
<span class="author"><a href="/members#{{post.author}}">{{post.author}}</a></span><br>
<span class="date"><em>{{ post.date | date_to_long_string }}</em></span>
</p>
<div class="content">
{{ post.content }}
</div>
<hr>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p class="author">
<span class="author"><a href="/members#{{post.author}}">{{post.author}}</a></span><br>
<span class="date"><em>{{ post.date | date_to_long_string }}</em></span>
{% if post.tags.size > 0 %}
<br>tags:
{% for tag in post.tags %}
{% assign tag_slug = tag | slugify: "raw" %}
<a class="tag-link" href={{ site.baseurl | append: "/tags/" | append: tag_slug | append: "/" }} rel="category tag">
#{{ tag }}
</a>
{% endfor %}
{% endif %}
</p>
<div class="content">
{{ post.content }}
</div>
{% endfor %}
<hr>

<!-- This makes links to other paginator pages -->
{% if paginator.total_pages > 1 %}
<ul class="pagination">
<li> {% if paginator.previous_page %} <a href="{{ paginator.previous_page_path }}"> {% endif %} Prev</a>&nbsp;</li>
<li> {% if paginator.previous_page %} <a href="{{ paginator.previous_page_path }}"> {% endif %} Prev</a>&nbsp;</li>

{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<li class="active">{{ page }}&nbsp;</li>
{% elsif page == 1 %}
<li><a href="/news/">{{ page }}</a>&nbsp;</li>
{% else %}
<li><a href="/news/page{{ page }}">{{ page }}</a>&nbsp;</li>
{% endif %}
{% if page == paginator.page %}
<li class="active">{{ page }}&nbsp;</li>
{% elsif page == 1 %}
<li><a href="/news/">{{ page }}</a>&nbsp;</li>
{% else %}
<li><a href="/news/page{{ page }}">{{ page }}</a>&nbsp;</li>
{% endif %}
{% endfor %}

<li> {% if paginator.next_page %} <a href="{{ paginator.next_page_path }}"> {% endif %} Next</a></li>
<li> {% if paginator.next_page %} <a href="{{ paginator.next_page_path }}"> {% endif %} Next</a></li>
</ul>
{% endif %}
{% endif %}

0 comments on commit 7e66b0a

Please sign in to comment.