From fcfbb6118ff6f6772380d7a151eba25ee70b49a4 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 21 Jan 2024 10:34:27 +0800 Subject: [PATCH] :sparkles: Posts --- .gitignore | 3 +- astro.config.mjs | 7 ++- package.json | 2 + src/components/Navbar.astro | 9 ++-- src/layouts/RootLayout.astro | 10 ++++- src/pages/events/index.astro | 2 +- src/pages/posts/[...slug].astro | 79 +++++++++++++++++++++++++++++++++ src/pages/posts/index.astro | 55 +++++++++++++++++++++++ tina/collection/event.ts | 1 - tina/collection/post.ts | 10 ++--- tina/config.ts | 2 +- tina/tina-lock.json | 2 +- tsconfig.json | 3 ++ yarn.lock | 43 ++++++++++++++++-- 14 files changed, 207 insertions(+), 21 deletions(-) create mode 100644 src/pages/posts/[...slug].astro create mode 100644 src/pages/posts/index.astro diff --git a/.gitignore b/.gitignore index bc1d9a4..843af95 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ pnpm-debug.log* .DS_Store # Development content -/content \ No newline at end of file +content +public/media \ No newline at end of file diff --git a/astro.config.mjs b/astro.config.mjs index f07b2ca..849c280 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,10 +1,13 @@ import { defineConfig } from "astro/config"; import mdx from "@astrojs/mdx"; import tailwind from "@astrojs/tailwind"; - import react from "@astrojs/react"; +import sitemap from "@astrojs/sitemap"; + // https://astro.build/config export default defineConfig({ - integrations: [mdx(), tailwind(), react()] + output: "hybrid", + site: "https://smartsheep.studio", + integrations: [mdx(), tailwind(), react(), sitemap()] }); \ No newline at end of file diff --git a/package.json b/package.json index e7b6769..2acb816 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,10 @@ }, "dependencies": { "@astrojs/check": "^0.4.1", + "@astrojs/deno": "^5.0.1", "@astrojs/mdx": "^2.0.5", "@astrojs/react": "^3.0.9", + "@astrojs/sitemap": "^3.0.5", "@astrojs/tailwind": "^5.1.0", "@popperjs/core": "^2.11.8", "@types/react": "^18.2.48", diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 53c1f27..58d3988 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -7,12 +7,12 @@ interface MenuItem { const items: MenuItem[] = [ { href: "/posts", label: "记录" }, - { href: "/annoucements", label: "情报" }, + { href: "/events", label: "情报" }, { href: "/projects", label: "企划" }, ]; --- -