diff --git a/plugins/blog/components/Share.tsx b/components/Share.tsx similarity index 100% rename from plugins/blog/components/Share.tsx rename to components/Share.tsx diff --git a/fresh.config.ts b/fresh.config.ts index a4acddf8..9423c151 100644 --- a/fresh.config.ts +++ b/fresh.config.ts @@ -6,7 +6,6 @@ import errorHandling from "./plugins/error_handling.ts"; import securityHeaders from "./plugins/security_headers.ts"; import type { FreshConfig } from "$fresh/server.ts"; import { ga4Plugin } from "https://deno.land/x/fresh_ga4@0.0.4/mod.ts"; -import { blog } from "./plugins/blog/mod.ts"; export default { plugins: [ @@ -16,6 +15,5 @@ export default { tailwind(), errorHandling, securityHeaders, - blog(), ], } satisfies FreshConfig; diff --git a/fresh.gen.ts b/fresh.gen.ts index 62d4fc73..b9bd45c3 100644 --- a/fresh.gen.ts +++ b/fresh.gen.ts @@ -16,9 +16,12 @@ import * as $api_users_login_index from "./routes/api/users/[login]/index.ts"; import * as $api_users_login_items from "./routes/api/users/[login]/items.ts"; import * as $api_users_index from "./routes/api/users/index.ts"; import * as $api_vote from "./routes/api/vote.ts"; +import * as $blog_slug_ from "./routes/blog/[slug].tsx"; +import * as $blog_index from "./routes/blog/index.tsx"; import * as $dashboard_index from "./routes/dashboard/index.tsx"; import * as $dashboard_stats from "./routes/dashboard/stats.tsx"; import * as $dashboard_users from "./routes/dashboard/users.tsx"; +import * as $feed from "./routes/feed.ts"; import * as $index from "./routes/index.tsx"; import * as $pricing from "./routes/pricing.tsx"; import * as $submit from "./routes/submit.tsx"; @@ -45,9 +48,12 @@ const manifest = { "./routes/api/users/[login]/items.ts": $api_users_login_items, "./routes/api/users/index.ts": $api_users_index, "./routes/api/vote.ts": $api_vote, + "./routes/blog/[slug].tsx": $blog_slug_, + "./routes/blog/index.tsx": $blog_index, "./routes/dashboard/index.tsx": $dashboard_index, "./routes/dashboard/stats.tsx": $dashboard_stats, "./routes/dashboard/users.tsx": $dashboard_users, + "./routes/feed.ts": $feed, "./routes/index.tsx": $index, "./routes/pricing.tsx": $pricing, "./routes/submit.tsx": $submit, diff --git a/plugins/blog/mod.ts b/plugins/blog/mod.ts deleted file mode 100644 index 04c0e844..00000000 --- a/plugins/blog/mod.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license. -import type { Plugin } from "$fresh/server.ts"; -import BlogIndex from "./routes/blog/index.tsx"; -import BlogSlug from "./routes/blog/[slug].tsx"; -import Feed from "./routes/feed.ts"; - -export function blog(): Plugin { - return { - name: "blog", - routes: [{ - path: "/blog", - component: BlogIndex, - }, { - path: "/blog/[slug]", - component: BlogSlug, - }, { - path: "/feed", - component: Feed, - }], - }; -} diff --git a/plugins/blog/routes/blog/[slug].tsx b/routes/blog/[slug].tsx similarity index 92% rename from plugins/blog/routes/blog/[slug].tsx rename to routes/blog/[slug].tsx index 9b765a38..005a3942 100644 --- a/plugins/blog/routes/blog/[slug].tsx +++ b/routes/blog/[slug].tsx @@ -1,9 +1,9 @@ // Copyright 2023-2025 the Deno authors. All rights reserved. MIT license. import { defineRoute } from "$fresh/server.ts"; import { CSS, render } from "jsr:@deno/gfm"; -import { getPost } from "../../utils/posts.ts"; +import { getPost } from "@/utils/posts.ts"; import Head from "@/components/Head.tsx"; -import Share from "../../components/Share.tsx"; +import Share from "@/components/Share.tsx"; export default defineRoute(async (_req, ctx) => { const post = await getPost(ctx.params.slug); diff --git a/plugins/blog/routes/blog/index.tsx b/routes/blog/index.tsx similarity index 95% rename from plugins/blog/routes/blog/index.tsx rename to routes/blog/index.tsx index 5e373c62..0ffc4557 100644 --- a/plugins/blog/routes/blog/index.tsx +++ b/routes/blog/index.tsx @@ -1,6 +1,6 @@ // Copyright 2023-2025 the Deno authors. All rights reserved. MIT license. import { defineRoute } from "$fresh/server.ts"; -import { getPosts, type Post } from "../../utils/posts.ts"; +import { getPosts, type Post } from "@/utils/posts.ts"; import Head from "@/components/Head.tsx"; function PostCard(props: Post) { diff --git a/plugins/blog/routes/feed.ts b/routes/feed.ts similarity index 96% rename from plugins/blog/routes/feed.ts rename to routes/feed.ts index bf59369c..2ac3c6b4 100644 --- a/plugins/blog/routes/feed.ts +++ b/routes/feed.ts @@ -1,6 +1,6 @@ // Copyright 2023-2025 the Deno authors. All rights reserved. MIT license. import { Feed } from "npm:feed@4.2.2"; -import { getPosts } from "../utils/posts.ts"; +import { getPosts } from "@/utils/posts.ts"; import { SITE_NAME } from "@/utils/constants.ts"; import { defineRoute } from "$fresh/server.ts"; diff --git a/plugins/blog/utils/posts.ts b/utils/posts.ts similarity index 100% rename from plugins/blog/utils/posts.ts rename to utils/posts.ts diff --git a/plugins/blog/utils/posts_test.ts b/utils/posts_test.ts similarity index 100% rename from plugins/blog/utils/posts_test.ts rename to utils/posts_test.ts