links rss
This commit is contained in:
parent
82ae1ef877
commit
e5e4dbacf0
4 changed files with 15 additions and 31 deletions
|
@ -114,8 +114,10 @@ export default async (config) => {
|
|||
config.addCollection("links", fetchShaarliWebroll)
|
||||
|
||||
config.addCollection("combinedFeed", (collectionApi) => {
|
||||
return collectionApi.getAllSorted().filter(item => {
|
||||
return (item.data.tags ?? []).some(t => ['posts', 'recipes', 'links'].includes(t))
|
||||
return collectionApi.getAllSorted().filter((item) => {
|
||||
return (item.data.tags ?? []).some((t) =>
|
||||
["posts", "recipes", "links"].includes(t)
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -184,19 +186,23 @@ async function fetchShaarliWebroll() {
|
|||
)
|
||||
}
|
||||
const entries = feedContent.map((entry) => {
|
||||
const content = entry.content["#text"].split(
|
||||
'\n<br>— <a href="https://links.apps.seigler.net/'
|
||||
)[0]
|
||||
return {
|
||||
url: entry.link["@_href"],
|
||||
date: new Date(entry.published),
|
||||
content,
|
||||
data: {
|
||||
title: entry.title,
|
||||
date: new Date(entry.published),
|
||||
description: entry.content["#text"].split(
|
||||
'\n<br>— <a href="https://links.apps.seigler.net/'
|
||||
)[0],
|
||||
tags: entry.category
|
||||
.map((category) => category["@_label"])
|
||||
.filter((category) => category !== "$webroll"),
|
||||
description: content,
|
||||
tags: ['links'],
|
||||
// tags: entry.category
|
||||
// .map((category) => category["@_label"])
|
||||
// .filter((category) => category !== "$webroll"),
|
||||
},
|
||||
}
|
||||
})
|
||||
}).sort((a, b) => a.date.getTime() - b.date.getTime())
|
||||
return entries
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ pagination:
|
|||
filter:
|
||||
- all
|
||||
- pages
|
||||
- links
|
||||
- timeline
|
||||
eleventyComputed:
|
||||
finalLink: "{% if tag == 'combinedFeed' %}feed.xml{% else %}feeds/{{tag | slugify}}.xml{% endif %}"
|
||||
|
|
0
site/pages/links.md
Normal file
0
site/pages/links.md
Normal file
|
@ -1,21 +0,0 @@
|
|||
---
|
||||
layout: "base.njk"
|
||||
title: "Links"
|
||||
permalink: /links/
|
||||
useTitle: true
|
||||
---
|
||||
<main>
|
||||
<section data-pagefind-body>
|
||||
<ul class="collection">
|
||||
{%- for item in collections.links -%}
|
||||
<li>
|
||||
<a href="{{item.url}}">{{item.data.title}}</a>
|
||||
{%- if item.data.date -%}
|
||||
<aside>{{item.data.date | formatDate("MMMM DD, YYYY") }}</aside>
|
||||
{%- endif -%}
|
||||
{{item.data.description | safe}}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
Loading…
Add table
Add a link
Reference in a new issue