Implement issues for v1.1.0 #20

Merged
phlaym merged 24 commits from v1.1.0 into main 2023-04-07 15:07:41 +00:00
7 changed files with 17 additions and 6 deletions
Showing only changes of commit 4d689a86ab - Show all commits

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
*.db *.db
feed.xml
node_modules node_modules
/build /build

View File

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="theme-color" content="#17063B" media="(prefers-color-scheme: dark)" /> <meta name="theme-color" content="#17063B" media="(prefers-color-scheme: dark)" />
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" /> <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
<link rel="alternate" type="application/atom+xml" href="/feed.xml" title="Atom Feed" />
%sveltekit.head% %sveltekit.head%
<style> <style>
body { body {

View File

@ -18,8 +18,8 @@ export const handleError = (({ error }) => {
import type { Handle } from '@sveltejs/kit'; import type { Handle } from '@sveltejs/kit';
export const handle = (async ({ event, resolve }) => { export const handle = (async ({ event, resolve }) => {
if (event.url.pathname === '/feed.atom') { if (event.url.pathname === '/feed.xml') {
const f = await fs.readFile('feed.atom', { encoding: 'utf8' }); const f = await fs.readFile('feed.xml', { encoding: 'utf8' });
return new Response( return new Response(
f, f,
{ headers: [['Content-Type', 'application/atom+xml']] } { headers: [['Content-Type', 'application/atom+xml']] }

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> <script>
import git from '$lib/assets/git-branch-fill.svg'; import git from '$lib/assets/git-branch-fill.svg';
import rss from '$lib/assets/rss-fill.svg';
</script> </script>
<div class="footer"> <div class="footer">
@ -11,7 +12,14 @@
<div> <div>
<a href="https://phlaym.net/git/phlaym/moshing-mammut"> <a href="https://phlaym.net/git/phlaym/moshing-mammut">
<img alt="Git branch" src={git} class="icon" /> <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> </a>
</div> </div>
</div> </div>

View File

@ -17,7 +17,7 @@ export function createFeed(posts: Post[]): Feed {
copyright: '', copyright: '',
generator: 'moshing-mamut', generator: 'moshing-mamut',
feedLinks: { feedLinks: {
atom: `${BASE_URL}/feed.atom` atom: `${BASE_URL}/feed.xml`
}, },
author: { author: {
name: '@aymm', name: '@aymm',
@ -41,5 +41,5 @@ export function createFeed(posts: Post[]): Feed {
return feed; return feed;
} }
export async function saveAtomFeed(feed: 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 && if (found_urls.length === 0 &&
found_tags.length === 0 && found_tags.length === 0 &&
!await TimelineReader.checkYoutubeMatches(post.content)) { !await TimelineReader.checkYoutubeMatches(post.content)) {
//return; return;
} }
await savePost(post); await savePost(post);
const posts = await getPosts(null, null, 100); const posts = await getPosts(null, null, 100);