-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32302d7
commit 3d6eb2c
Showing
17 changed files
with
57 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { z, defineCollection } from 'astro:content' | ||
|
||
const noteCollection = defineCollection({ | ||
type: 'content', | ||
schema: z.object({ | ||
title: z.string(), | ||
pubDate: z.string(), | ||
tags: z.array(z.string()), | ||
}) | ||
}) | ||
|
||
export const collections = { 'notes': noteCollection } |
1 change: 0 additions & 1 deletion
1
...add-full-path-to-default-ohmyzsh-theme.md → ...add-full-path-to-default-ohmyzsh-theme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...pages/notes/custom-shortcuts-in-vscode.md → ...ntent/notes/custom-shortcuts-in-vscode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/pages/notes/delete-all-git-history.md → src/content/notes/delete-all-git-history.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/pages/notes/docker-multi-stage-build.md → ...content/notes/docker-multi-stage-build.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...pages/notes/huginn-docker-compose-file.md → ...ntent/notes/huginn-docker-compose-file.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...-number-of-objects-stored-in-s3-bucket.md → ...-number-of-objects-stored-in-s3-bucket.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/pages/notes/my-first-post.md → src/content/notes/my-first-post.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
layout: '../../layouts/Note.astro' | ||
title: 'My First Note' | ||
pubDate: 02-01-2024 | ||
tags: ['note'] | ||
|
1 change: 0 additions & 1 deletion
1
...es/notes/reset-sidebar-views-in-vscode.md → ...nt/notes/reset-sidebar-views-in-vscode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...s/send-raw-string-as-body-using-httpie.md → ...s/send-raw-string-as-body-using-httpie.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...hemes-for-markdown-syntax-highlighting.md → ...hemes-for-markdown-syntax-highlighting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...te-host-through-bastion-in-one-command.md → ...te-host-through-bastion-in-one-command.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
import Note from '../../layouts/Note.astro' | ||
import { getCollection } from 'astro:content' | ||
export async function getStaticPaths() { | ||
const allNotes = await getCollection('notes') | ||
allNotes.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate)) | ||
return allNotes.map(note => ({ | ||
params: { slug: note.slug }, props: { note } | ||
})) | ||
} | ||
const { note } = Astro.props | ||
const { Content } = await note.render() | ||
--- | ||
|
||
<Note frontmatter={note.data}> | ||
<Content /> | ||
</Main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import rss, { pagesGlobToRssItems } from '@astrojs/rss'; | ||
import rss from '@astrojs/rss' | ||
import { getCollection } from 'astro:content' | ||
|
||
export async function GET(context) { | ||
const notes = await getCollection('notes') | ||
notes.sort((a, b) => new Date(b.data.pubDate) - new Date(a.data.pubDate)) | ||
|
||
return rss({ | ||
title: 'Derek Brown\'s Notes', | ||
description: 'Notes from Derek Brown.', | ||
site: context.site, | ||
items: await pagesGlobToRssItems(import.meta.glob('./notes/*.{md,mdx}')) | ||
items: notes.map((note) => ({ | ||
title: note.data.title, | ||
pubDate: note.data.pubDate, | ||
link: `/note/${note.slug}/` | ||
})) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters