Feature/rss feed (#192)

* installed @11ty/eleventy-plugin-rss package and added it to the config

* adding default rss template from the 11ty documentation

* using 'definedWords' as a collection, not 'posts'

* added a link to the feed in the html head, on the homepage so it's co-located with the other means of engagement, and in the feed itself (permalink is now part of metadata too)

* metadata.description is what we want to show as the feed subtitle, and made the author name safe as part of the metadata json; can't use the safe filter otherwise xml blows up

* removed redundant --- from right below the frontmatter, which md turns into a <hr>, which makes xml blow up

* made indentation consistent

* removing subscribe link from the CTA box, adding it to the footer next to Documentation link with bullet delimiter; updated site footer's ul style to show list items as display-block elements

* on definition pages, the footer is constrained to have the max width of the sidebar (160px). set grid-column: 1 / -1 to give it the full width to match the home/toc page

* created a new collection for sorting only defined words via their .date value (should be created date unless otherwise specified)

* RSS feed now shows posts in the order used by new definedWordsChronological collection

* reversed sort order as requested

* re-prettier-ifying eleventy.js

Co-authored-by: Oscar <ovlb@users.noreply.github.com>
This commit is contained in:
Kate Sowles
2020-06-12 02:21:37 -07:00
committed by GitHub
parent 67298c7da2
commit 2a8f1014b8
9 changed files with 117 additions and 116 deletions

View File

@ -1,9 +1,11 @@
{
"title": "Self-Defined",
"url": "https://www.selfdefined.app/",
"feedPermalink": "/feed.xml",
"description": "A modern dictionary about us. We define our words, but they don't define us.",
"author": {
"name": "Tatiana & the Crew",
"name_safe": "Tatiana &amp; the Crew",
"email": "info@selfdefined.app"
}
}

View File

@ -13,6 +13,7 @@
>
<link rel="stylesheet" href="https://use.typekit.net/qlo3dpu.css" rel="preload"/>
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
<link rel="alternate" type="application/atom+xml" href="{{ metadata.feedPermalink | absoluteUrl(metadata.url) }}"/>
{% block pageStyles %}
{% endblock pageStyles %}
</head>
@ -24,6 +25,10 @@
<li>
<a href="/documentation/">Documentation</a>
</li>
&bull;
<li>
<a href="{{ metadata.feedPermalink | absoluteUrl(metadata.url) }}">RSS Feed</a>
</li>
</ul>
</nav>
</footer>

View File

@ -16,7 +16,7 @@ reading:
- text: "Anti-Oppression: Anti-Fatmisia"
href: https://simmons.libguides.com/anti-oppression/anti-fatmisia
---
---
from Greek for hate or hatred
## Use

View File

@ -14,10 +14,10 @@ alt_words:
- malformed
- silly
reading:
- text: Derp is ableist and offensive
href: https://americandramedy.blogspot.com/2013/06/derp-is-ableist-and-offensive-stop.html
- text: Ableist words and terms to avoid
href: https://www.autistichoya.com/p/ableist-words-and-terms-to-avoid.html
- text: Derp is ableist and offensive
href: https://americandramedy.blogspot.com/2013/06/derp-is-ableist-and-offensive-stop.html
- text: Ableist words and terms to avoid
href: https://www.autistichoya.com/p/ableist-words-and-terms-to-avoid.html
---
clumsy, foolish, unattractive, or otherwise unintelligent act or person.

27
11ty/feed.njk Normal file
View File

@ -0,0 +1,27 @@
---
permalink: "feed.xml"
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ metadata.title }}</title>
<subtitle>{{ metadata.description }}</subtitle>
<link href="{{ metadata.feedPermalink | absoluteUrl(metadata.url) }}" rel="self"/>
<link href="{{ metadata.url }}"/>
<updated>{{ collections.definedWords | rssLastUpdatedDate }}</updated>
<id>{{ metadata.url }}</id>
<author>
<name>{{ metadata.author.name_safe }}</name>
<email>{{ metadata.author.email }}</email>
</author>
{%- for post in collections.definedWordsChronological %}
{% set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset %}
<entry>
<title>{{ post.data.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<updated>{{ post.date | rssDate }}</updated>
<id>{{ absolutePostUrl }}</id>
<content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry>
{%- endfor %}
</feed>