Comments (3)
You're free to add any other fields, bulk of the stuff here is done in getRssData
.
export async function getRssData() {
const feed = new rss({
title: "Hanami Mastery newest episodes!",
description: "The best way to master Hanami ruby framework!",
feed_url: "https://hanamimastery.com/rss.xml",
site_url: "https://hanamimastery.com",
image_url: "https://hanamimastery.com/logo-hm.jpeg",
managingEditor: "Sebastian Wilgosz",
webMaster: "Sebastian Wilgosz",
copyright: "2021 Sebastian Wilgosz",
language: "en",
categories: ["Ruby", "Hanami", "Web development"],
pubDate: new Date().toLocaleString(),
ttl: "60",
});
const posts = await getAllFilesFrontMatter("stray");
const episodes = await getAllFilesFrontMatter("episodes");
const postsWithSlug = posts.map((item) => ({
...item,
url: `https://hanamimastery.com/articles/${item.slug}`,
}));
const episodesWithSlug = episodes.map((item) => ({
...item,
url: `https://hanamimastery.com/episodes/${item.slug}`,
}));
const items = postsWithSlug.concat(episodesWithSlug).sort((itemA, itemB) => {
if (itemA.id > itemB.id) return -1;
if (itemA.id < itemB.id) return 1;
return 0;
});
items.map(({ author, tags, title, id, url }) => {
feed.item({ author, title, categories: tags, guid: id, url });
});
return feed;
}
Regarding sorting via file creation date - it's always going to change. During deployment, will always be the same, since the repo is being built after having been downloaded onto Vercel's machines.
A good alternative - specify written_at or created_at in font matter and then sort by this. Let me know if you run into any issues, too - dealing with time and dates in js can be gruesome.
from hanamimastery.
@adamszwaba here are some of the troubles I've noticed.
- http://rubyland.news/sources - This rss reader has problems parsing my feed.
- The content is not loaded (type HTML).
- Feedly does not show the content, when you click the single episode.
- Also, feedly shows ALL episodes, as published at the same time, currently 3h ago.
What I've noticed, is that all my strings/text is wrapped within the ![CDATA]
blocks, which are basically comments ref
from hanamimastery.
Closing for now, I'll open different issue for the RSS tweaks.
from hanamimastery.
Related Issues (20)
- RSS Tweaks
- Upgrade Next.js to 11.x HOT 1
- Add related Articles Component HOT 2
- UI issues after Next update HOT 2
- RSS Not working
- Add filtering by tags
- Direct access of the discussions view on the widget does not work. HOT 1
- Allow for special markdown tags in the data files.
- Make left-sidebar sticky when scrolling through the content.
- Share Buttons not working on FireFox HOT 1
- Optimize single article content styles (typography) for better readability
- Set Canonical Tag on single article/episode to prevent content duplication
- Allow for adding unpublished episodes.
- Social media sharing issues - thumbnail not fetched
- Better Syntax highlighting for code snippets.
- Allow to add author information for articles and episodes.
- Add a table of contents component
- Redesign the single episode page HOT 22
- Fix the sharing counter when navigating between pages.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hanamimastery.