Skip to content

Commit

Permalink
Update syndication feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
DeclanChidlow committed Jan 23, 2025
1 parent fd95fa9 commit 3fed6a7
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/micro_data.ori
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
micros
→ =map(_, (micro) => {
→ =map(_, (micro, fileName) => {
...micro
type: "micro"
pub_time: functions/micro-date.js(basename(fileName))
title: `${ functions/pretty-date.js(pub_time) } ${ functions/pretty-time.js(pub_time) }`
})
→ =map(_, {
extension: ".md->.html"
value: (micro) => functions/parse-markdown.js(micro)
})
→ =map(_, (micro, fileName) => { …micro, pub_time: functions/micro-date.js(basename(fileName)) })
→ reverse
15 changes: 15 additions & 0 deletions src/micro_syndication.ori
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(micros) => {
version: "https://jsonfeed.org/version/1.1"
title: "Vale.Rocks Micros"
description: "A collection of unhinged (yet not completely insane) ramblings."
home_page_url: "https://vale.rocks"
feed_url: "https://vale.rocks/micros/feed.json"

items: values(map(micros, (micro, slug) => {
id: `https://vale.rocks/micros/${ slug }`
url: `https://vale.rocks/micros/${ slug }`
title: micro/title
content_html: micro/@text
date_published: micro/pub_time
}))
}
3 changes: 1 addition & 2 deletions src/micro_template.ori
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(micro) => main_template.ori({
title: `Micro - ${ functions/pretty-date.js(micro/pub_time) } ${ functions/pretty-time.js(micro/pub_time) }`
// description: micro/@text
title: micro/title
stylesheet: "pages/micro-individual.css"

@text: indent`
Expand Down
17 changes: 17 additions & 0 deletions src/photography_syndication.ori
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(photography) => {
version: "https://jsonfeed.org/version/1.1"
title: "Vale.Rocks Photography"
description: "Photos I have taken presented for one's viewing pleasure."
home_page_url: "https://vale.rocks"
feed_url: "https://vale.rocks/photography/feed.json"

items: values(map(photography, (photo, slug) => {
id: `https://vale.rocks/photography/${ slug }`
url: `https://vale.rocks/photography/${ slug }`
title: photo/description
image: photo/image
content_html: photo/@text
summary: photo/alt_text
date_published: photo/pub_time
}))
}
2 changes: 1 addition & 1 deletion src/photography_template.ori
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(photography) => main_template.ori({
title: photography/description
description: photography/description
description: photography/alt_text
pub_time: photography/pub_time
image: photography/image
alt_text: photography/alt_text
Expand Down
6 changes: 3 additions & 3 deletions src/syndication.ori → src/post_syndication.ori
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(posts) => {
version: "https://jsonfeed.org/version/1.1"
title: "Vale.Rocks"
description: "A collection of unhinged (yet not completely insane) ramblings."
title: "Vale.Rocks Posts"
description: "Long form writings about assorted topics."
home_page_url: "https://vale.rocks"
feed_url: "https://vale.rocks/posts/feed.json"

Expand All @@ -12,6 +12,6 @@
content_html: post/@text
summary: post/description
date_published: post/pub_time
date_published: post/mod_time
date_modified: post/mod_time
}))
}
12 changes: 6 additions & 6 deletions src/site.ori
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
posts.html = pages/posts.ori(post_data.ori)
posts = {
...map(post_data.ori, post_template.ori)
feed.json = json(syndication.ori(post_data.ori))
feed.xml = rss(syndication.ori(post_data.ori))
feed.json = json(post_syndication.ori(post_data.ori))
feed.xml = rss(post_syndication.ori(post_data.ori))
}

micros = {
...map(micro_data.ori, micro_template.ori)
feed.json = json(syndication.ori(micro_data.ori))
feed.xml = rss(syndication.ori(micro_data.ori))
feed.json = json(micro_syndication.ori(micro_data.ori))
feed.xml = rss(micro_syndication.ori(micro_data.ori))
}

photography.html = pages/photography.ori(photography_data.ori)
photography = {
...map(photography_data.ori, photography_template.ori)
feed.json = json(syndication.ori(photography_data.ori))
feed.xml = rss(syndication.ori(photography_data.ori))
feed.json = json(photography_syndication.ori(photography_data.ori))
feed.xml = rss(photography_syndication.ori(photography_data.ori))
}

(paginated_firehose) = paginate(firehose_data.ori, 15)
Expand Down

0 comments on commit 3fed6a7

Please sign in to comment.