more post support

This commit is contained in:
2026-04-14 22:19:26 +01:00
parent b61ecb13bd
commit da06ae1279
11 changed files with 124 additions and 43 deletions
+12
View File
@@ -0,0 +1,12 @@
<script lang="ts" module>
</script>
<script lang="ts">
let props = $props();
</script>
<h1>meow</h1>
{@render props.children?.()}
<style>
</style>
+16
View File
@@ -0,0 +1,16 @@
<script module lang="ts">
let posts = import.meta.glob("/src/routes/posts/*.md", { eager: true });
type Post = {
title: string;
description: string;
catagory: string;
date: Date;
updated: Date;
tags: [string];
};
export function getPosts(): Promise<Array<Post>> {
Object.entries(posts).map(([path, module]) => {
console.log(path, module.metadata);
});
}
</script>
-8
View File
@@ -1,8 +0,0 @@
<script lang="ts">
// You can import components or define shared logic here
</script>
<!-- This renders the content of the current page (e.g., an .svx file) -->
<slot />
<footer>&copy; 2026 My Site</footer>
+1 -2
View File
@@ -1,13 +1,12 @@
<script lang="ts" module>
import json from "./dic.json";
const imageModules = import.meta.glob(
"./imgs/*.{avif,AVIF,heif,HEIF,jpeg,gif,GIF,JPEG,jpg,JPG,png,PNG,tiff,TIFF,webp,WEBP}",
"./imgs/*.{avif,AVIF,heif,HEIF,jpeg,JPEG,jpg,JPG,png,PNG,tiff,TIFF,webp,WEBP}",
{
eager: true,
import: "default",
query: {
enhanced: true,
format: "gif",
},
},
);
+3
View File
@@ -4,8 +4,11 @@
import { SidebarRight } from "$lib/sidebar/sidebar_right.svelte";
import { WebButtons } from "$lib/web_buttons/webButtons.svelte";
import { NavBar } from "$lib/nav.svelte";
import PostHelpers, { getPosts } from "$lib/PostHelpers.svelte";
let { children } = $props();
export const prerender = true;
getPosts();
</script>
<svelte:head>