more post support
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<script lang="ts" module>
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
let props = $props();
|
||||
</script>
|
||||
|
||||
<h1>meow</h1>
|
||||
{@render props.children?.()}
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -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>
|
||||
@@ -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>© 2026 My Site</footer>
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user