1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 06:36:04 +00:00

move blog posts into their own directory

This commit is contained in:
mat 2023-12-09 15:59:19 -06:00
parent bf8a6ec2cb
commit 0ea916235d
22 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import path from 'path'
import fs from 'fs'
export const postsDir = 'src/routes' as const
export const postsDir = 'src/routes/(blog)' as const
export async function listBlogPostSlugs(): Promise<string[]> {
await fs.promises.readdir(postsDir)
@ -55,7 +55,7 @@ export async function getPost(slug: string): Promise<BlogPost | null> {
const url = new URL(`protocol://-/${slug}`)
const { default: post, metadata } = await import(`../routes/${slug}/index.svx`)
const { default: post, metadata } = await import(`../routes/(blog)/${slug}/index.svx`)
const result: {
title: string

View file

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

View file

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View file

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -8,7 +8,7 @@ export const load: Load = async ({ params }) => {
let page
try {
page = await import(`../../${slug}/index.svx`)
page = await import(`../../(blog)/${slug}/index.svx`)
} catch (e) {
throw error(404, 'Not found')
}