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"> <link rel="stylesheet" type="text/css" href="/assets/css/prism.min.css">
{% endif %} {% endif %}
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css"> <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.rss if feed.rss else "/rss.xml" }}">
<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 if feed.atom else "/atom.xml" }}">
<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 if feed.json else "/feed.json" }}">
<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="me" href="proven.lol/f730ca"> <link rel="me" href="proven.lol/f730ca">
<link rel="me" href="https://social.lewisdale.dev/@lewis"> <link rel="me" href="https://social.lewisdale.dev/@lewis">
<link rel="me" href="https://github.com/LewisDaleUK"> <link rel="me" href="https://github.com/LewisDaleUK">

View File

@ -9,6 +9,12 @@ pagination:
<main class="wrapper-md stack-lg"> <main class="wrapper-md stack-lg">
<h1>Blog posts</h1> <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'> <ol class="stack-xl" role='list'>
{% for item in pagination.items %} {% for item in pagination.items %}
<li class="stack-xs"> <li class="stack-xs">

View File

@ -1,18 +1,32 @@
--- ---json
title: Blog {
layout: base.njk "title": "Blog",
pagination: "layout": "base.njk",
data: collections.tags "pagination": {
size: 1 "data": "collections.tags",
alias: tag "size": 1,
eleventyComputed: "alias": "tag"
permalink: "/post/tag/{{ tag }}/" },
feed: "/post/tag/{{ tag }}/feed/" "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"> <main class="wrapper-md stack-lg">
<h1>Posts tagged “{{ tag }}”</h1> <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'> <ol class="stack-xl" role='list'>
{% set posts = collections.posts | filterBy(tag) | reverse %} {% set posts = collections.posts | filterBy(tag) | reverse %}
{% for item in posts %} {% for item in posts %}

View File

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