From b8d7b2dcffbd070937fa1029741a1fb6618ae48c Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Sat, 14 Sep 2024 00:59:54 -0700 Subject: [PATCH] feat: Metadata file, customization doc --- README.md | 25 +++++--- package-lock.json | 67 +++++++++++++++++++++ package.json | 1 + src/app.css | 2 + src/content/home.md | 15 +++++ src/content/metadata.json | 6 ++ src/content/post/placeholder1.md | 5 ++ src/routes/+layout.svelte | 2 + src/routes/+page.svelte | 31 +++++++--- src/routes/Footer.svelte | 14 +++++ src/routes/about/+page.svelte | 2 - src/routes/post/+page.svelte | 5 ++ src/routes/post/[slug]/+page.svelte | 5 ++ src/routes/sitemap.ts | 3 +- src/style/content.css | 90 +++++++++++++++++++++++++++++ svelte.config.js | 5 +- 16 files changed, 257 insertions(+), 21 deletions(-) create mode 100644 src/content/metadata.json create mode 100644 src/routes/Footer.svelte delete mode 100644 src/routes/about/+page.svelte create mode 100644 src/style/content.css diff --git a/README.md b/README.md index dfd1666..c34de39 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,6 @@ # Chrysoblog -Personal Website - -## Developing - -Install dependencies with `npm install` (or `pnpm install` or `yarn`). Then start the dev server with - -```bash -npm run dev [-- --open] -``` +A blog framework ## Building @@ -19,3 +11,18 @@ npm run build ``` You can preview the production build with `npm run preview`. + +### Content + +To insert custom content, replace +- `src/content/metadata.json`: This file controls the display format for titles, front cover, etc. +- `src/content/**/*.md`: These contain the blog posts and bio + +## Developing + +Install dependencies with `npm install` (or `pnpm install` or `yarn`). Then start the dev server with + +```bash +npm run dev [-- --open] +``` + diff --git a/package-lock.json b/package-lock.json index 9adb829..9bc6785 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "tailwindcss": "^3.4.9", "typescript": "^5.0.0", "typescript-eslint": "^8.0.0", + "unist-util-visit": "^5.0.0", "vite": "^5.0.3", "vitest": "^2.0.0" } @@ -4450,6 +4451,27 @@ } } }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/unist-util-stringify-position": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", @@ -4464,6 +4486,51 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/unist-util-visit/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/update-browserslist-db": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", diff --git a/package.json b/package.json index ad647a4..eb98f25 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "tailwindcss": "^3.4.9", "typescript": "^5.0.0", "typescript-eslint": "^8.0.0", + "unist-util-visit": "^5.0.0", "vite": "^5.0.3", "vitest": "^2.0.0" }, diff --git a/src/app.css b/src/app.css index bf7b0d5..14e2a9a 100644 --- a/src/app.css +++ b/src/app.css @@ -1,3 +1,4 @@ +@import url(./style/content.css); @tailwind base; @tailwind components; @tailwind utilities; @@ -79,3 +80,4 @@ html { scroll-behavior: smooth; } + diff --git a/src/content/home.md b/src/content/home.md index 01f12d5..9a78182 100644 --- a/src/content/home.md +++ b/src/content/home.md @@ -5,3 +5,18 @@ name: Cirno Strongest of Gensokyo +- Associate Professor in Pure Mathematics (1970 - ) + +## Publications + +Perfect Math Class + +# Projects + +> This is a quote + +```python +print("this is python") +``` + + diff --git a/src/content/metadata.json b/src/content/metadata.json new file mode 100644 index 0000000..3b990e8 --- /dev/null +++ b/src/content/metadata.json @@ -0,0 +1,6 @@ +{ + "name": "Cirno", + "blogName": "Cirno's Blog", + "frontDescription": "This is a very long description.", + "frontCover": "/favicon.svg" +} diff --git a/src/content/post/placeholder1.md b/src/content/post/placeholder1.md index 7521202..8a1d070 100644 --- a/src/content/post/placeholder1.md +++ b/src/content/post/placeholder1.md @@ -5,3 +5,8 @@ date: '2024-09-01' # Placeholder Post 1 Here is some placeholder text + +## 2nd level heading + +### 3rd level heading +#### 4th level heading diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 010f0f9..13484bb 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,6 +2,7 @@ import '../app.css'; import { page } from '$app/stores'; import { Separator } from "$lib/components/ui/separator/index.js"; + import Footer from "./Footer.svelte"; import { routes } from "./sitemap.ts" @@ -19,6 +20,7 @@ {/if} +