rss fixes
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
src/components/icons/*.astro
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
import RSSIcon from './icons/RSS.astro'
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -8,4 +9,7 @@ const year = new Date().getFullYear()
|
|||||||
>Astro</a
|
>Astro</a
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="/rss.xml"> Subscribe with RSS</a>
|
||||||
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -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
@@ -5,20 +5,20 @@ const blogCollection = defineCollection({
|
|||||||
title: z.string(),
|
title: z.string(),
|
||||||
pubDate: z.string().transform((str) => new Date(str)),
|
pubDate: z.string().transform((str) => new Date(str)),
|
||||||
tags: z.array(
|
tags: z.array(
|
||||||
z.union([
|
z.enum([
|
||||||
z.literal('Apps'),
|
'Apps',
|
||||||
z.literal('Gaming'),
|
'Gaming',
|
||||||
z.literal('Learning'),
|
'Learning',
|
||||||
z.literal('Life'),
|
'Life',
|
||||||
z.literal('MacOS'),
|
'MacOS',
|
||||||
z.literal('Music'),
|
'Music',
|
||||||
z.literal('Making Stuff'),
|
'Making Stuff',
|
||||||
z.literal('Mental Health'),
|
'Mental Health',
|
||||||
z.literal('Movies & TV'),
|
'Movies & TV',
|
||||||
z.literal('Programming'),
|
'Programming',
|
||||||
z.literal('Tech'),
|
'Tech',
|
||||||
z.literal('Tutorial'),
|
'Tutorial',
|
||||||
z.literal('Web Dev'),
|
'Web Dev',
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ const title = Astro.props.frontmatter
|
|||||||
name="description"
|
name="description"
|
||||||
content="My personal blog about life, gaming, tech, and whatever else I feel like writing about."
|
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>
|
<title>{`ghall.blog - ${title}`}</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="container">
|
<body class="container">
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ title: Page Not Found
|
|||||||
|
|
||||||
My name is **Graham**, a web developer from Rhode Island.
|
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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const parser = new MarkdownIt({ html: true })
|
|||||||
|
|
||||||
export async function get(context) {
|
export async function get(context) {
|
||||||
const blog = await getCollection('blog')
|
const blog = await getCollection('blog')
|
||||||
|
console.log(blog)
|
||||||
return rss({
|
return rss({
|
||||||
title: 'ghall.blog',
|
title: 'ghall.blog',
|
||||||
description:
|
description:
|
||||||
@@ -14,9 +15,10 @@ export async function get(context) {
|
|||||||
items: blog
|
items: blog
|
||||||
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
||||||
.map((post) => ({
|
.map((post) => ({
|
||||||
|
title: post.data.title,
|
||||||
|
pubDate: post.data.pubDate,
|
||||||
link: `/posts/${post.slug}/`,
|
link: `/posts/${post.slug}/`,
|
||||||
content: sanitizeHtml(parser.render(post.body)),
|
content: sanitizeHtml(parser.render(post.body)),
|
||||||
...post.data,
|
|
||||||
})),
|
})),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user