Add Atom feeds for categories and tags

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2022-01-11 04:26:31 +01:00
parent 6ab54af0e1
commit 3bbec65141
4 changed files with 60 additions and 10 deletions
+6
View File
@@ -1,4 +1,10 @@
{% include page_start.liquid %}
{% for data in page.categories %}
<link rel="alternate" type="application/atom+xml" title="Category: {{ data }}" href="{{ site.feed.categories.path | append: data | append: ".xml" | absolute_url }}">
{% endfor %}
{% for data in page.tags %}
<link rel="alternate" type="application/atom+xml" title="Tag: {{ data }}" href="{{ site.feed.tags.path | append: data | append: ".xml" | absolute_url }}">
{% endfor %}
{% include page_content.liquid %}
{% include breadcrumbs.liquid title=page.title permalink=page.url %}
{% include article.liquid type=post title=page.title content=page.content timestamp=page.date permalink=page.url tags=page.tags %}
+29
View File
@@ -0,0 +1,29 @@
{% include page_start.liquid %}
<link rel="alternate" type="application/atom+xml" title="Tag: {{ page.autopage.display_name }}" href="{{ site.autopages.tags.permalink | replace: ":tag", page.autopage.display_name | absolute_url }}">
{% include page_content.liquid %}
{% include breadcrumbs.liquid title=page.title permalink=page.url %}
<div id="index">
{% for data in paginator.posts %}
{% if site.xaymar.index.excerpt.enabled %}
{% assign content=data.excerpt | strip_html | normalize_whitespace | truncatewords: site.xaymar.index.excerpt.length %}
{% else %}
{% assign content=data.content %}
{% endif %}
{% include article.liquid type=post index=true title=data.title content=content permalink=data.url categories=data.categories tags=data.tags timestamp=data.date %}
{% endfor %}
</div>
{% if paginator.total_pages > 1 %}
<ul class="pager">
{% if paginator.previous_page %}
<li class="previous">
<a href="{{ paginator.previous_page_path | absolute_url }}">&larr; Newer Posts</a>
</li>
{% endif %}
{% if paginator.next_page %}
<li class="next">
<a href="{{ paginator.next_page_path | absolute_url }}">Older Posts &rarr;</a>
</li>
{% endif %}
</ul>
{% endif %}
{% include page_end.liquid %}