From b1f669416ca08b9c7a84a26337f10a0e507ee7aa Mon Sep 17 00:00:00 2001 From: Sehyun Chung Date: Tue, 19 Dec 2023 01:41:23 +0900 Subject: [PATCH] `/note`->`/notes` --- fresh.gen.ts | 12 ++++++------ routes/index.tsx | 4 +--- routes/{note => notes}/[slug].tsx | 16 +++++++--------- routes/{note => notes}/_layout.tsx | 9 ++++++++- routes/{note => notes}/index.tsx | 30 +++++++++++++++--------------- static/styles.css | 16 +++++++++++++++- 6 files changed, 52 insertions(+), 35 deletions(-) rename routes/{note => notes}/[slug].tsx (86%) rename routes/{note => notes}/_layout.tsx (57%) rename routes/{note => notes}/index.tsx (51%) 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 ( <> - -