Add RSS feed to footer and page. Fix #8

This commit is contained in:
2023-04-05 16:57:25 +02:00
parent d723d4264a
commit 4d689a86ab
7 changed files with 17 additions and 6 deletions

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M3 3C12.9411 3 21 11.0589 21 21H18C18 12.7157 11.2843 6 3 6V3ZM3 10C9.07513 10 14 14.9249 14 21H11C11 16.5817 7.41828 13 3 13V10ZM3 17C5.20914 17 7 18.7909 7 21H3V17Z" fill="#000"></path></svg>

After

Width:  |  Height:  |  Size: 285 B

View File

@ -1,5 +1,6 @@
<script>
import git from '$lib/assets/git-branch-fill.svg';
import rss from '$lib/assets/rss-fill.svg';
</script>
<div class="footer">
@ -11,7 +12,14 @@
<div>
<a href="https://phlaym.net/git/phlaym/moshing-mammut">
<img alt="Git branch" src={git} class="icon" />
Source Code&nbsp;
Source Code
</a>
</div>
|
<div>
<a href="/feed.xml">
<img alt="RSS" src={rss} class="icon" />
RSS Feed
</a>
</div>
</div>

View File

@ -17,7 +17,7 @@ export function createFeed(posts: Post[]): Feed {
copyright: '',
generator: 'moshing-mamut',
feedLinks: {
atom: `${BASE_URL}/feed.atom`
atom: `${BASE_URL}/feed.xml`
},
author: {
name: '@aymm',
@ -41,5 +41,5 @@ export function createFeed(posts: Post[]): Feed {
return feed;
}
export async function saveAtomFeed(feed: Feed) {
await fs.writeFile('feed.atom', feed.atom1(), { encoding: 'utf8' });
await fs.writeFile('feed.xml', feed.atom1(), { encoding: 'utf8' });
}

View File

@ -78,7 +78,7 @@ export class TimelineReader {
if (found_urls.length === 0 &&
found_tags.length === 0 &&
!await TimelineReader.checkYoutubeMatches(post.content)) {
//return;
return;
}
await savePost(post);
const posts = await getPosts(null, null, 100);