Add aside with link to feeds

This commit is contained in:
Lewis Dale 2023-12-30 20:10:07 +00:00
parent c8c98c7ef9
commit 2f3c0cc739
4 changed files with 41 additions and 19 deletions

View File

@ -21,15 +21,10 @@
<link rel="stylesheet" type="text/css" href="/assets/css/prism.min.css">
{% endif %}
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css">
{% if feed %}
<link rel="alternate" type="application/rss+xml" title="LewisDale.Dev" href="{{ feed }}">
<link rel="alternate" type="application/atom+xml" title="LewisDale.Dev Atom Feed" href="{{ feed }}atom">
<link rel="alternate" type="application/json" title="LewisDale.Dev JSON Feed" href="{{ feed }}json">
{% else %}
<link rel="alternate" type="application/rss+xml" title="LewisDale.Dev" href="/feed/">
<link rel="alternate" type="application/atom+xml" title="LewisDale.Dev Atom Feed" href="/feed/atom">
<link rel="alternate" type="application/json" title="LewisDale.Dev JSON Feed" href="/feed/json">
{% endif %}
<link rel="alternate" type="application/rss+xml" title="LewisDale.Dev" href="{{ feed.rss if feed.rss else "/rss.xml" }}">
<link rel="alternate" type="application/atom+xml" title="LewisDale.Dev Atom Feed" href="{{ feed.atom if feed.atom else "/atom.xml" }}">
<link rel="alternate" type="application/json" title="LewisDale.Dev JSON Feed" href="{{ feed.json if feed.json else "/feed.json" }}">
<link rel="me" href="proven.lol/f730ca">
<link rel="me" href="https://social.lewisdale.dev/@lewis">
<link rel="me" href="https://github.com/LewisDaleUK">

View File

@ -9,6 +9,12 @@ pagination:
<main class="wrapper-md stack-lg">
<h1>Blog posts</h1>
<aside class="text-center">
<p>
Subscribe via <a href="/rss.xml">RSS</a>, <a href="/atom.xml">Atom</a>, or <a href="/feed.json">JSON</a>.
</p>
</aside>
<ol class="stack-xl" role='list'>
{% for item in pagination.items %}
<li class="stack-xs">

View File

@ -1,18 +1,32 @@
---
title: Blog
layout: base.njk
pagination:
data: collections.tags
size: 1
alias: tag
eleventyComputed:
permalink: "/post/tag/{{ tag }}/"
feed: "/post/tag/{{ tag }}/feed/"
---json
{
"title": "Blog",
"layout": "base.njk",
"pagination": {
"data": "collections.tags",
"size": 1,
"alias": "tag"
},
"eleventyComputed": {
"permalink": "/post/tag/{{ tag }}/",
"feed": {
"rss": "{{ page.url }}rss.xml",
"atom": "{{ page.url }}atom.xml",
"json": "{{ page.url }}feed.json"
}
}
}
---
<main class="wrapper-md stack-lg">
<h1>Posts tagged “{{ tag }}”</h1>
<aside class="text-center">
<p>
Subscribe via <a href="{{ feed.rss }}">RSS</a>, <a href="{{ feed.atom }}">Atom</a>, or <a href="{{ feed.json }}">JSON</a>.
</p>
</aside>
<ol class="stack-xl" role='list'>
{% set posts = collections.posts | filterBy(tag) | reverse %}
{% for item in posts %}

View File

@ -134,3 +134,10 @@ footer {
border-radius: 5px;
outline-offset: 4px;
}
aside {
width: 100%;
background-color: var(--color-primary);
color: var(--color-secondary);
padding: var(--space-size-s);
}