diff --git a/README.md b/README.md index 336bdd7..77f68d6 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ directory. The website will be built statically in `build/`. Note that changing ## Developing +Install [pre-commit](https://pre-commit.com/). + Install dependencies with `npm install` (or `pnpm install` or `yarn`). Then start the dev server with @@ -43,4 +45,3 @@ npx playwright test All tests must have the suffix `.spec.[jt]s`. Be cautious while updating `playwright` since the versions in `nixpkgs` and `node` must exactly match. - diff --git a/components.json b/components.json index 8fed8f7..ce35209 100644 --- a/components.json +++ b/components.json @@ -11,4 +11,4 @@ "utils": "$lib/utils" }, "typescript": true -} \ No newline at end of file +} diff --git a/eslint.config.js b/eslint.config.js index c8f2571..1240824 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,7 +17,7 @@ export default [ ...tseslint.configs.recommended, { rules: { - "no-unused-vars": [ + "@typescript-eslint/no-unused-vars": [ "error", { "argsIgnorePattern": "^_", diff --git a/src/app.css b/src/app.css index 0d90f55..193a062 100644 --- a/src/app.css +++ b/src/app.css @@ -4,73 +4,73 @@ @tailwind base; @tailwind components; @tailwind utilities; - + @layer base { :root { --background: 0 0% 90%; --foreground: 20 14.3% 4.1%; - + --muted: 60 4.8% 95.9%; --muted-foreground: 25 5.3% 44.7%; - + --popover: 0 0% 100%; --popover-foreground: 20 14.3% 4.1%; - + --card: 0 0% 100%; --card-foreground: 20 14.3% 4.1%; - + --border: 20 5.9% 90%; --input: 20 5.9% 90%; - + --primary: 24 9.8% 10%; --primary-foreground: 60 9.1% 97.8%; - + --secondary: 60 4.8% 95.9%; --secondary-foreground: 24 9.8% 10%; - + --accent: 60 4.8% 95.9%; --accent-foreground: 24 9.8% 10%; - + --destructive: 0 72.2% 50.6%; --destructive-foreground: 60 9.1% 97.8%; - + --ring: 20 14.3% 4.1%; - + --radius: 0.5rem; } - + .dark { --background: 20 14.3% 4.1%; --foreground: 60 9.1% 97.8%; - + --muted: 12 6.5% 15.1%; --muted-foreground: 24 5.4% 63.9%; - + --popover: 20 14.3% 4.1%; --popover-foreground: 60 9.1% 97.8%; - + --card: 20 14.3% 4.1%; --card-foreground: 60 9.1% 97.8%; - + --border: 12 6.5% 15.1%; --input: 12 6.5% 15.1%; - + --primary: 60 9.1% 97.8%; --primary-foreground: 24 9.8% 10%; - + --secondary: 12 6.5% 15.1%; --secondary-foreground: 60 9.1% 97.8%; - + --accent: 12 6.5% 15.1%; --accent-foreground: 60 9.1% 97.8%; - + --destructive: 0 62.8% 30.6%; --destructive-foreground: 60 9.1% 97.8%; - + --ring: 24 5.7% 82.9%; } } - + @layer base { * { @apply border-border; diff --git a/src/content/archives.md b/src/content/archives.md index 4fe3b2f..c2a6133 100644 --- a/src/content/archives.md +++ b/src/content/archives.md @@ -1,4 +1,3 @@ # Archives Archives live here - diff --git a/src/content/home.md b/src/content/home.md index c3d21ff..fbed528 100644 --- a/src/content/home.md +++ b/src/content/home.md @@ -23,5 +23,3 @@ Strongest of Gensokyo for i in range(9): print("this is python") ``` - - diff --git a/src/lib/markdown.js b/src/lib/markdown.js index 6b7b55b..97d103c 100644 --- a/src/lib/markdown.js +++ b/src/lib/markdown.js @@ -48,7 +48,7 @@ function remarkAlert/*: Plugin<[Option?], Root> = */() /*=>*/ { } return item; }); - if (!!alertType) { + if (alertType) { node.data = { hName: "div", hProperties: { diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 8871245..28aa936 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -59,4 +59,4 @@ export const flyAndScale = ( }, easing: cubicOut }; -}; \ No newline at end of file +}; diff --git a/src/routes/+page.ts b/src/routes/+page.ts index 683da3a..49a3d18 100644 --- a/src/routes/+page.ts +++ b/src/routes/+page.ts @@ -1,10 +1,10 @@ import { error } from '@sveltejs/kit'; import type { PageLoad } from './$types'; -export const load: PageLoad = async ({ params }) => { +export const load: PageLoad = async (_) => { const post = await import(`$content/home.md`); if (!post) throw error(404); - const { name, date } = post.metadata; + const { name } = post.metadata; const Content = post.default; return { diff --git a/src/routes/archives/+page.ts b/src/routes/archives/+page.ts index 6dae9d3..efeea04 100644 --- a/src/routes/archives/+page.ts +++ b/src/routes/archives/+page.ts @@ -1,7 +1,6 @@ -import { error } from '@sveltejs/kit'; import type { PageLoad } from './$types'; -export const load: PageLoad = async ({ params }) => { +export const load: PageLoad = async (_) => { const post = await import("$content/archives.md"); const Content = post.default; diff --git a/src/routes/post/+page.server.ts b/src/routes/post/+page.server.ts index 283c681..368c4b9 100644 --- a/src/routes/post/+page.server.ts +++ b/src/routes/post/+page.server.ts @@ -1,6 +1,6 @@ import type { PageLoad } from './$types'; -export const load: PageLoad = async ({ params }) => { +export const load: PageLoad = async (_) => { const allPostFiles = import.meta.glob('$content/post/*.md'); const iterablePostFiles = Object.entries(allPostFiles); diff --git a/src/routes/post/[slug]/+page.ts b/src/routes/post/[slug]/+page.ts index de6d407..7c82d3a 100644 --- a/src/routes/post/[slug]/+page.ts +++ b/src/routes/post/[slug]/+page.ts @@ -15,7 +15,7 @@ export const load: PageLoad = async ({ params }) => { Content, }; } - catch(e) { + catch { error(404, `Could not find post ${params.slug}`) } } diff --git a/static/favicon.svg b/static/favicon.svg index a135916..a818f6b 100644 --- a/static/favicon.svg +++ b/static/favicon.svg @@ -1 +1 @@ -logo \ No newline at end of file +logo diff --git a/tailwind.config.ts b/tailwind.config.ts index 514354c..0b7da4c 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,5 +1,6 @@ -import { fontFamily } from "tailwindcss/defaultTheme"; +//import { fontFamily } from "tailwindcss/defaultTheme"; import type { Config } from "tailwindcss"; +import typography from '@tailwindcss/typography'; const config: Config = { darkMode: ["class"], @@ -103,12 +104,12 @@ const config: Config = { sans: '"Source Han Sans SC", "Source Han Sans CN","Noto Sans CJK SC", "Noto Sans", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif', //For varible font usage sometimes // 'serif': '"Source Han Serif CN Variable", "Source Han Serif SC", "Source Han Serif CN","Noto Serif CJK SC", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif', - serif: '"Source Han Serif SC", "Source Han Serif CN","Noto Serif CJK SC", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif', - cursive: 'FancyTitleFont,"Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif', + serif: '"Source Han Serif SC", "Source Han Serif CN","Noto Serif CJK SC", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif', + cursive: 'FancyTitleFont,"Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif', mono: "'Fira Code','Cascadia Code',Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New','Sarasa Mono SC','Noto Sans CJK SC','monospace', monospace" }, typography: ((theme) => { - let markdownCommon = { + const markdownCommon = { h1: { color: theme('colors.eucalyptus.700'), }, @@ -149,7 +150,7 @@ const config: Config = { } }, plugins: [ - require('@tailwindcss/typography'), + typography, ], };