Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions blog-website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ const config = {
},
docs: false,
blog: {
feedOptions: {
type: 'all',
title: 'I CAN MAKE THIS WORK',
description: 'The blog of johnnyreilly ❤️🌻',
language: 'en',
copyright: `Copyright © 2012 - ${new Date().getFullYear()} John Reilly.`,
},
blogTitle: 'I CAN MAKE THIS WORK',
blogDescription: 'The blog of johnnyreilly',
/**
Expand Down
26 changes: 20 additions & 6 deletions trim-xml/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,23 @@ interface AtomFeed {
subtitle: string;
icon: string;
entry: {
title: string;
title: {
'@_type': string;
content: string;
};
id: string;
link: {
href: string;
'@_href': string;
};
updated: string;
summary: string;
content: string;
summary: {
'@_type': string;
content: string;
};
content: {
'@_type': string;
content: string;
};
author: {
name: string;
uri: string;
Expand Down Expand Up @@ -181,7 +190,10 @@ async function trimAtomXML() {
let rss: AtomFeed = parser.parse(atomXml);

console.log(rss);
const top20Entries = rss.feed.entry.slice(0, 20);
console.log(rss.feed.entry);
const top20Entries = rss.feed.entry
.slice(0, 20)
.map((entry) => ({ ...entry, id: entry.link['@_href'] })); // fixup the id with full link

console.log(
`Reducing ${rss.feed.entry.length} entries to ${top20Entries.length} entries`
Expand Down Expand Up @@ -213,7 +225,9 @@ async function trimRssXML() {
let rss: RssFeed = parser.parse(rssXml);

console.log(rss);
const top20Entries = rss.rss.channel.item.slice(0, 20);
const top20Entries = rss.rss.channel.item
.slice(0, 20)
.map((item) => ({ ...item, guid: item.link })); // fixup the guid with full link

console.log(
`Reducing ${rss.rss.channel.item.length} entries to ${top20Entries.length} entries`
Expand Down