diff --git a/fresh.gen.ts b/fresh.gen.ts
index 9df674d8..5941d80f 100644
--- a/fresh.gen.ts
+++ b/fresh.gen.ts
@@ -8,9 +8,9 @@ import * as $_layout from "./routes/_layout.tsx";
import * as $_middleware from "./routes/_middleware.ts";
import * as $api_joke from "./routes/api/joke.ts";
import * as $index from "./routes/index.tsx";
-import * as $note_slug_ from "./routes/note/[slug].tsx";
-import * as $note_layout from "./routes/note/_layout.tsx";
-import * as $note_index from "./routes/note/index.tsx";
+import * as $notes_slug_ from "./routes/notes/[slug].tsx";
+import * as $notes_layout from "./routes/notes/_layout.tsx";
+import * as $notes_index from "./routes/notes/index.tsx";
import * as $Counter from "./islands/Counter.tsx";
import { type Manifest } from "$fresh/server.ts";
@@ -22,9 +22,9 @@ const manifest = {
"./routes/_middleware.ts": $_middleware,
"./routes/api/joke.ts": $api_joke,
"./routes/index.tsx": $index,
- "./routes/note/[slug].tsx": $note_slug_,
- "./routes/note/_layout.tsx": $note_layout,
- "./routes/note/index.tsx": $note_index,
+ "./routes/notes/[slug].tsx": $notes_slug_,
+ "./routes/notes/_layout.tsx": $notes_layout,
+ "./routes/notes/index.tsx": $notes_index,
},
islands: {
"./islands/Counter.tsx": $Counter,
diff --git a/routes/index.tsx b/routes/index.tsx
index 21738b18..d1bbb920 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -2,10 +2,8 @@ import { useSignal } from "@preact/signals";
import Counter from "../islands/Counter.tsx";
export default function Home() {
- const count = useSignal(3);
return (
-
-
+
);
}
diff --git a/routes/note/[slug].tsx b/routes/notes/[slug].tsx
similarity index 86%
rename from routes/note/[slug].tsx
rename to routes/notes/[slug].tsx
index 34f0308f..82405998 100644
--- a/routes/note/[slug].tsx
+++ b/routes/notes/[slug].tsx
@@ -5,6 +5,7 @@ import { extract } from "https://deno.land/std@0.145.0/encoding/front_matter.ts"
import { join } from "$std/path/mod.ts";
import { Handlers, PageProps } from "$fresh/server.ts";
+import he120 from "https://esm.sh/he@1.2.0";
export interface Note {
title: string;
@@ -55,17 +56,14 @@ export const handler: Handlers
= {
export default function PostPage(props: PageProps) {
const post = props.data;
+ const __html = render(post.content);
return (
<>
-
-
-
-
+ {post.title}
+
>
);
}
diff --git a/routes/note/_layout.tsx b/routes/notes/_layout.tsx
similarity index 57%
rename from routes/note/_layout.tsx
rename to routes/notes/_layout.tsx
index 98b3ff25..5489ba78 100644
--- a/routes/note/_layout.tsx
+++ b/routes/notes/_layout.tsx
@@ -7,7 +7,14 @@ export default function NoteRouteLayout({ Component }: PageProps) {
Notes
-
+
>
);
}
diff --git a/routes/note/index.tsx b/routes/notes/index.tsx
similarity index 51%
rename from routes/note/index.tsx
rename to routes/notes/index.tsx
index 22b64fbd..f764f18d 100644
--- a/routes/note/index.tsx
+++ b/routes/notes/index.tsx
@@ -1,4 +1,4 @@
-import { CSS, render } from "https://deno.land/x/gfm@0.2.5/mod.ts";
+import { render } from "https://deno.land/x/gfm@0.2.5/mod.ts";
import { Handlers, PageProps } from "$fresh/server.ts";
import { getAllNote, Note } from "./[slug].tsx";
@@ -9,35 +9,35 @@ export const handler: Handlers = {
},
};
-function PostCard(props: { post: Note }) {
+function NoteCard(props: { post: Note }) {
const { post } = props;
return (
-
+ >
);
}
export default function BlogIndexPage(props: PageProps) {
const posts = props.data;
return (
-
- Notes
-
- {posts.map((post) =>
)}
-
-
+
+ {posts.map((post) => )}
+
);
}
diff --git a/static/styles.css b/static/styles.css
index bd6213e1..02465e7f 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -1,3 +1,17 @@
@tailwind base;
@tailwind components;
-@tailwind utilities;
\ No newline at end of file
+@tailwind utilities;
+
+.gfm {
+ h1, h2, h3, h4 {
+ font-weight: bold;
+ position: relative;
+ .anchor {
+ display: none;
+ svg {
+ position: absolute;
+ transform: translate(calc(-100% - 6px), 50%);
+ }
+ }
+ }
+}