├── .eleventy.js
├── .gitignore
├── README.md
├── app
└── lastAccessed.js
├── feedDataFormat.js
├── package-lock.json
├── package.json
└── src
├── _data
├── dateLimit.js
├── feeds.js
├── lastAccessed.js
└── meta.js
├── _includes
├── base.njk
├── postDate.njk
└── sourceCard.njk
├── feeds
├── css.json
├── eleventy.json
├── paginate
│ ├── categories.njk
│ ├── items.njk
│ └── sources.njk
└── podcasts.json
├── index.njk
└── sass
├── _card.scss
├── _item-articles.scss
├── _layout.scss
├── _prismtheme.scss
├── _reset.scss
├── _theme.scss
├── _utilities.scss
└── style.scss
/.eleventy.js:
--------------------------------------------------------------------------------
1 | const { DateTime } = require("luxon");
2 | const slugify = require("slugify");
3 | const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
4 |
5 | module.exports = function (eleventyConfig) {
6 | eleventyConfig.addPlugin(syntaxHighlight);
7 |
8 | eleventyConfig.addWatchTarget("./src/sass/");
9 |
10 | eleventyConfig.addFilter("slug", (str) => {
11 | return slugify(str, {
12 | lower: true,
13 | strict: true,
14 | remove: /["]/g,
15 | });
16 | });
17 |
18 | eleventyConfig.addFilter("postDate", (dateObj) => {
19 | return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED);
20 | });
21 |
22 | eleventyConfig.addShortcode("newCount", (items, source, slug) => {
23 | const newItems = items.filter((i) => {
24 | return i.data.source === source && i.data.new === "true";
25 | });
26 |
27 | return newItems.length > 0
28 | ? `${newItems.length} new items`
29 | : "";
30 | });
31 |
32 | eleventyConfig.addFilter("limit", function (arr, limit) {
33 | return arr.slice(0, limit);
34 | });
35 |
36 | eleventyConfig.addFilter("domain", function (url) {
37 | const domain = new URL(url);
38 |
39 | return domain.hostname.replace("www.", "");
40 | });
41 |
42 | eleventyConfig.addFilter("dateLimitDisplay", (dateObj) => {
43 | return DateTime.fromMillis(dateObj).toLocaleString(DateTime.DATE_MED);
44 | });
45 |
46 | eleventyConfig.addFilter("stripUnsafe", (content) => {
47 | const regex = /
55 | {% endif %}
56 |