chore: add back json feeds
This commit is contained in:
parent
7d78546205
commit
74279cf2d5
15 changed files with 91 additions and 53 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "21.8.1",
|
"version": "21.8.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "21.8.1",
|
"version": "21.8.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cdransf/api-text": "^1.4.0",
|
"@cdransf/api-text": "^1.4.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "21.8.1",
|
"version": "21.8.2",
|
||||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:feedpress="https://feed.press/xmlns" version="1.0">
|
|
||||||
<xsl:template match="/">
|
|
||||||
<html>
|
|
||||||
<xsl:copy-of select="$html_TemplateHeader"/>
|
|
||||||
<xsl:apply-templates select="rss/channel"/>
|
|
||||||
</html>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template match="channel">
|
|
||||||
<body class="main-wrapper">
|
|
||||||
<header class="main-title">
|
|
||||||
<h1><xsl:value-of select="title"/></h1>
|
|
||||||
<a href="{$feedUrl}" class="link-icon">
|
|
||||||
<svg class="rss-icon" stroke="var(--brand-rss)"></svg>
|
|
||||||
</a>
|
|
||||||
</header>
|
|
||||||
<main>
|
|
||||||
<section class="posts-wrapper">
|
|
||||||
<xsl:apply-templates select="item"/>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
<footer>
|
|
||||||
<xsl:copy-of select="$html_FeedFooterScripts"/>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template match="item">
|
|
||||||
<article class="home-status article">
|
|
||||||
<header>
|
|
||||||
<h2>
|
|
||||||
<a href="{link}">
|
|
||||||
<xsl:value-of select="title"/>
|
|
||||||
</a>
|
|
||||||
</h2>
|
|
||||||
</header>
|
|
||||||
<p><xsl:value-of select="description"/></p>
|
|
||||||
<footer>
|
|
||||||
<div class="time-wrapper">
|
|
||||||
<time datetime="{pubDate}">
|
|
||||||
<xsl:value-of select="pubDate"/>
|
|
||||||
</time>
|
|
||||||
<span rel="author">
|
|
||||||
<xsl:value-of select="author"/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</article>
|
|
||||||
</xsl:template>
|
|
||||||
</xsl:stylesheet>
|
|
21
src/includes/partials/feeds/json.liquid
Normal file
21
src/includes/partials/feeds/json.liquid
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"version": "https://jsonfeed.org/version/1",
|
||||||
|
"title": "{{ title }}",
|
||||||
|
"home_page_url": "{{ permalink | absoluteUrl: globals.url }}",
|
||||||
|
"feed_url": "{{ permalink | absoluteUrl: globals.url }}.json",
|
||||||
|
"description": "{{ description }}",
|
||||||
|
"icon": "https://cdn.coryd.dev/{{ globals.feed_image }}?class=w200&v={% appVersion %}",
|
||||||
|
"favicon": "https://cdn.coryd.dev/{{ globals.favicon_ico }}?class=w50&v={% appVersion %}",
|
||||||
|
"items": [
|
||||||
|
{%- assign entries = data | normalizeEntries: 20 -%}
|
||||||
|
{%- for entry in entries -%}
|
||||||
|
{
|
||||||
|
"id": "{{ entry.url | encodeAmp }}",
|
||||||
|
"url": "{{ entry.url | encodeAmp }}",
|
||||||
|
"title": "{{ entry.title | escape }}{%- if entry.authors %} via {{ entry.authors.name }}{%- endif %}{%- if entry.rating %} ({{ entry.rating }}){%- endif %}",
|
||||||
|
"content_text": "{{ entry.excerpt | escape }}",
|
||||||
|
"date_published": "{{ entry.date | stringToRFC822Date }}"
|
||||||
|
}{%- if forloop.last == false %},{%- endif -%}
|
||||||
|
{%- endfor %}
|
||||||
|
]
|
||||||
|
}
|
|
@ -10,7 +10,7 @@
|
||||||
<image>
|
<image>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link>{{ permalink | absoluteUrl: globals.url }}</link>
|
<link>{{ permalink | absoluteUrl: globals.url }}</link>
|
||||||
<url>https://cdn.coryd.dev/{{ globals.feed_image }}</url>
|
<url>https://cdn.coryd.dev/{{ globals.feed_image }}?class=w200&v={% appVersion %}</url>
|
||||||
<width>144</width>
|
<width>144</width>
|
||||||
<height>144</height>
|
<height>144</height>
|
||||||
</image>
|
</image>
|
||||||
|
|
13
src/pages/feeds/json/all.liquid
Normal file
13
src/pages/feeds/json/all.liquid
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
layout: null
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
permalink: "/feeds/all.json"
|
||||||
|
---
|
||||||
|
{% render "partials/feeds/json.liquid"
|
||||||
|
permalink:"/feeds/all"
|
||||||
|
title:"Cory Dransfeldt: all activity"
|
||||||
|
description:"All of the posts and activity from my site."
|
||||||
|
data:collections.allContent
|
||||||
|
updated:collections.allContent[0].date
|
||||||
|
site:site
|
||||||
|
%}
|
14
src/pages/feeds/json/books.liquid
Normal file
14
src/pages/feeds/json/books.liquid
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
layout: null
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
permalink: "/feeds/books.json"
|
||||||
|
---
|
||||||
|
{%- assign bookData = books.all | bookStatus: 'finished' | bookSortDescending -%}
|
||||||
|
{% render "partials/feeds/json.liquid"
|
||||||
|
permalink:"/feeds/books"
|
||||||
|
title:"Cory Dransfeldt: books"
|
||||||
|
description:"Books I'm currently reading."
|
||||||
|
data:bookData
|
||||||
|
updated:bookData[0].date
|
||||||
|
site:site
|
||||||
|
%}
|
13
src/pages/feeds/json/feed.liquid
Normal file
13
src/pages/feeds/json/feed.liquid
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
layout: null
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
permalink: "/feeds/posts.json"
|
||||||
|
---
|
||||||
|
{% render "partials/feeds/json.liquid"
|
||||||
|
permalink:"/feeds/posts"
|
||||||
|
title:"Cory Dransfeldt"
|
||||||
|
description:"Posts from my site."
|
||||||
|
data:posts
|
||||||
|
updated:posts[0].date
|
||||||
|
site:site
|
||||||
|
%}
|
13
src/pages/feeds/json/links.liquid
Normal file
13
src/pages/feeds/json/links.liquid
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
layout: null
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
permalink: "/feeds/links.json"
|
||||||
|
---
|
||||||
|
{% render "partials/feeds/json.liquid"
|
||||||
|
permalink:"/feeds/links"
|
||||||
|
title:"Cory Dransfeldt: links"
|
||||||
|
description:"Links I've liked."
|
||||||
|
data:links
|
||||||
|
updated:links[0].date
|
||||||
|
site:site
|
||||||
|
%}
|
13
src/pages/feeds/json/movies.liquid
Normal file
13
src/pages/feeds/json/movies.liquid
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
layout: null
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
permalink: "/feeds/movies.json"
|
||||||
|
---
|
||||||
|
{% render "partials/feeds/json.liquid"
|
||||||
|
permalink:"/feeds/movies"
|
||||||
|
title:"Cory Dransfeldt: movies"
|
||||||
|
description:"Movies I've watched recently."
|
||||||
|
data:movies.recentlyWatched
|
||||||
|
updated:movies.recentlyWatched[0].lastWatched
|
||||||
|
site:site
|
||||||
|
%}
|
Reference in a new issue