rss fixes

This commit is contained in:
2023-07-30 20:43:54 -04:00
parent acceb67d9a
commit ceb456b4fb
10 changed files with 33 additions and 19 deletions
+1
View File
@@ -0,0 +1 @@
src/components/icons/*.astro
+4
View File
@@ -1,4 +1,5 @@
---
import RSSIcon from './icons/RSS.astro'
const year = new Date().getFullYear()
---
@@ -8,4 +9,7 @@ const year = new Date().getFullYear()
>Astro</a
>
</p>
<p>
<a href="/rss.xml"> Subscribe with RSS</a>
</p>
</footer>
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 -960 960 960" width="48"><path d="M218-120q-41 0-69.5-28.5T120-218q0-41 28.5-69.5T218-316q41 0 69.5 28.5T316-218q0 41-28.5 69.5T218-120Zm492 0q0-122-46.5-229.5T537-537q-80-80-187.5-126.5T120-710v-90q141 0 264.5 53.5t216 146q92.5 92.5 146 216T800-120h-90Zm-238 0q0-158-97-259T120-480v-90q97 0 178 34t139.5 94Q496-382 529-299.5T562-120h-90Z"/></svg>

After

Width:  |  Height:  |  Size: 422 B

+14 -14
View File
@@ -5,20 +5,20 @@ const blogCollection = defineCollection({
title: z.string(),
pubDate: z.string().transform((str) => new Date(str)),
tags: z.array(
z.union([
z.literal('Apps'),
z.literal('Gaming'),
z.literal('Learning'),
z.literal('Life'),
z.literal('MacOS'),
z.literal('Music'),
z.literal('Making Stuff'),
z.literal('Mental Health'),
z.literal('Movies & TV'),
z.literal('Programming'),
z.literal('Tech'),
z.literal('Tutorial'),
z.literal('Web Dev'),
z.enum([
'Apps',
'Gaming',
'Learning',
'Life',
'MacOS',
'Music',
'Making Stuff',
'Mental Health',
'Movies & TV',
'Programming',
'Tech',
'Tutorial',
'Web Dev',
])
),
}),
+6
View File
@@ -24,6 +24,12 @@ const title = Astro.props.frontmatter
name="description"
content="My personal blog about life, gaming, tech, and whatever else I feel like writing about."
/>
<link
rel="alternate"
type="application/rss+xml"
title="ghall.blog - RSS"
href="/rss.xml"
/>
<title>{`ghall.blog - ${title}`}</title>
</head>
<body class="container">
+1 -1
View File
@@ -5,7 +5,7 @@ title: Page Not Found
My name is **Graham**, a web developer from Rhode Island.
When I'm not writing code, I'm usually enjoying one of my other hobbies; video games, music, hiking, photography, art, the list goes on...
When I'm not writing code, I'm usually enjoying one of my other hobbies; video games, board games, music, hiking, photography, art, the list goes on...
I also like writing about stuff, so I put together this site to share whatever's on my mind about the world of tech, gaming, life, web development, and whatever else strikes my fancy.
+3 -1
View File
@@ -6,6 +6,7 @@ const parser = new MarkdownIt({ html: true })
export async function get(context) {
const blog = await getCollection('blog')
console.log(blog)
return rss({
title: 'ghall.blog',
description:
@@ -14,9 +15,10 @@ export async function get(context) {
items: blog
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
.map((post) => ({
title: post.data.title,
pubDate: post.data.pubDate,
link: `/posts/${post.slug}/`,
content: sanitizeHtml(parser.render(post.body)),
...post.data,
})),
})
}