Skip to content

Commit 02d9e31

Browse files
committed
feat: use fuwari
1 parent 866f7e6 commit 02d9e31

File tree

117 files changed

+14247
-3538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+14247
-3538
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
manage-package-manager-versions = true

astro.config.mjs

Lines changed: 128 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,132 @@
1-
import { defineConfig } from 'astro/config';
2-
import mdx from '@astrojs/mdx';
3-
4-
import sitemap from '@astrojs/sitemap';
1+
import sitemap from "@astrojs/sitemap";
2+
import svelte from "@astrojs/svelte";
3+
import tailwind from "@astrojs/tailwind";
4+
import swup from "@swup/astro";
5+
import Compress from "astro-compress";
6+
import icon from "astro-icon";
7+
import { defineConfig } from "astro/config";
8+
import rehypeAutolinkHeadings from "rehype-autolink-headings";
9+
import rehypeComponents from "rehype-components"; /* Render the custom directive content */
10+
import rehypeKatex from "rehype-katex";
11+
import rehypeSlug from "rehype-slug";
12+
import remarkDirective from "remark-directive"; /* Handle directives */
13+
import remarkGithubAdmonitionsToDirectives from "remark-github-admonitions-to-directives";
14+
import remarkMath from "remark-math";
15+
import remarkSectionize from "remark-sectionize";
16+
import { AdmonitionComponent } from "./src/plugins/rehype-component-admonition.mjs";
17+
import { GithubCardComponent } from "./src/plugins/rehype-component-github-card.mjs";
18+
import { parseDirectiveNode } from "./src/plugins/remark-directive-rehype.js";
19+
import { remarkExcerpt } from "./src/plugins/remark-excerpt.js";
20+
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs";
521

622
// https://astro.build/config
723
export default defineConfig({
8-
site: 'https://example.com',
9-
integrations: [mdx(), sitemap()],
24+
site: "https://fuwari.vercel.app/",
25+
base: "/",
26+
trailingSlash: "always",
27+
integrations: [
28+
tailwind(
29+
{
30+
nesting: true,
31+
}
32+
),
33+
swup({
34+
theme: false,
35+
animationClass: "transition-swup-", // see https://swup.js.org/options/#animationselector
36+
// the default value `transition-` cause transition delay
37+
// when the Tailwind class `transition-all` is used
38+
containers: ["main", "#toc"],
39+
smoothScrolling: true,
40+
cache: true,
41+
preload: true,
42+
accessibility: true,
43+
updateHead: true,
44+
updateBodyClass: false,
45+
globalInstance: true,
46+
}),
47+
icon({
48+
include: {
49+
"preprocess: vitePreprocess(),": ["*"],
50+
"fa6-brands": ["*"],
51+
"fa6-regular": ["*"],
52+
"fa6-solid": ["*"],
53+
},
54+
}),
55+
svelte(),
56+
sitemap(),
57+
Compress({
58+
CSS: false,
59+
Image: false,
60+
Action: {
61+
Passed: async () => true, // https://github.com/PlayForm/Compress/issues/376
62+
},
63+
}),
64+
],
65+
markdown: {
66+
remarkPlugins: [
67+
remarkMath,
68+
remarkReadingTime,
69+
remarkExcerpt,
70+
remarkGithubAdmonitionsToDirectives,
71+
remarkDirective,
72+
remarkSectionize,
73+
parseDirectiveNode,
74+
],
75+
rehypePlugins: [
76+
rehypeKatex,
77+
rehypeSlug,
78+
[
79+
rehypeComponents,
80+
{
81+
components: {
82+
github: GithubCardComponent,
83+
note: (x, y) => AdmonitionComponent(x, y, "note"),
84+
tip: (x, y) => AdmonitionComponent(x, y, "tip"),
85+
important: (x, y) => AdmonitionComponent(x, y, "important"),
86+
caution: (x, y) => AdmonitionComponent(x, y, "caution"),
87+
warning: (x, y) => AdmonitionComponent(x, y, "warning"),
88+
},
89+
},
90+
],
91+
[
92+
rehypeAutolinkHeadings,
93+
{
94+
behavior: "append",
95+
properties: {
96+
className: ["anchor"],
97+
},
98+
content: {
99+
type: "element",
100+
tagName: "span",
101+
properties: {
102+
className: ["anchor-icon"],
103+
"data-pagefind-ignore": true,
104+
},
105+
children: [
106+
{
107+
type: "text",
108+
value: "#",
109+
},
110+
],
111+
},
112+
},
113+
],
114+
],
115+
},
116+
vite: {
117+
build: {
118+
rollupOptions: {
119+
onwarn(warning, warn) {
120+
// temporarily suppress this warning
121+
if (
122+
warning.message.includes("is dynamically imported by") &&
123+
warning.message.includes("but also statically imported by")
124+
) {
125+
return;
126+
}
127+
warn(warning);
128+
},
129+
},
130+
},
131+
},
10132
});

biome.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"extends": [],
4+
"files": { "ignoreUnknown": true },
5+
"organizeImports": {
6+
"enabled": true
7+
},
8+
"formatter": {
9+
"enabled": true,
10+
"formatWithErrors": false,
11+
"ignore": ["src/config.ts"],
12+
"indentStyle": "space",
13+
"indentWidth": 2,
14+
"lineWidth": 80
15+
},
16+
"javascript": {
17+
"parser": {
18+
"unsafeParameterDecoratorsEnabled": true
19+
},
20+
"formatter": {
21+
"quoteStyle": "single",
22+
"jsxQuoteStyle": "single",
23+
"trailingCommas": "all",
24+
"semicolons": "asNeeded",
25+
"arrowParentheses": "asNeeded"
26+
}
27+
},
28+
"json": {
29+
"parser": { "allowComments": true },
30+
"formatter": {
31+
"enabled": true,
32+
"indentStyle": "space",
33+
"indentWidth": 2,
34+
"lineWidth": 80
35+
}
36+
},
37+
"linter": {
38+
"ignore": [],
39+
"rules": {
40+
"a11y": {
41+
"recommended": true
42+
},
43+
"complexity": {
44+
"recommended": true
45+
},
46+
"correctness": {
47+
"recommended": true
48+
},
49+
"performance": {
50+
"recommended": true
51+
},
52+
"security": {
53+
"recommended": true
54+
},
55+
"style": {
56+
"recommended": true
57+
},
58+
"suspicious": {
59+
"recommended": true
60+
},
61+
"nursery": {
62+
"recommended": true
63+
}
64+
}
65+
}
66+
}

frontmatter.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
3+
"frontMatter.framework.id": "astro",
4+
"frontMatter.preview.host": "http://localhost:4321",
5+
"frontMatter.content.publicFolder": "public",
6+
"frontMatter.content.pageFolders": [
7+
{
8+
"title": "posts",
9+
"path": "[[workspace]]/src/content/posts"
10+
}
11+
],
12+
"frontMatter.taxonomy.contentTypes": [
13+
{
14+
"name": "default",
15+
"pageBundle": true,
16+
"previewPath": "'blog'",
17+
"filePrefix": null,
18+
"clearEmpty": true,
19+
"fields": [
20+
{
21+
"title": "title",
22+
"name": "title",
23+
"type": "string",
24+
"single": true
25+
},
26+
{
27+
"title": "description",
28+
"name": "description",
29+
"type": "string"
30+
},
31+
{
32+
"title": "published",
33+
"name": "published",
34+
"type": "datetime",
35+
"default": "{{now}}",
36+
"isPublishDate": true
37+
},
38+
{
39+
"title": "preview",
40+
"name": "image",
41+
"type": "image",
42+
"isPreviewImage": true
43+
},
44+
{
45+
"title": "tags",
46+
"name": "tags",
47+
"type": "list"
48+
},
49+
{
50+
"title": "category",
51+
"name": "category",
52+
"type": "string"
53+
},
54+
{
55+
"title": "draft",
56+
"name": "draft",
57+
"type": "boolean"
58+
},
59+
{
60+
"title": "language",
61+
"name": "language",
62+
"type": "string"
63+
}
64+
]
65+
}
66+
]
67+
}

package.json

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,70 @@
22
"name": "wsafight-blog",
33
"type": "module",
44
"version": "0.0.1",
5-
"private": true,
65
"scripts": {
76
"dev": "astro dev",
87
"start": "astro dev",
9-
"build": "astro build",
8+
"build": "astro build && pagefind --site dist",
109
"preview": "astro preview",
1110
"astro": "astro",
12-
"format": "npx @biomejs/biome format --write ./src"
11+
"type-check": "tsc --noEmit --isolatedDeclarations",
12+
"new-post": "node scripts/new-post.js",
13+
"format": "biome format --write ./src",
14+
"lint": "biome check --apply ./src",
15+
"preinstall": "npx only-allow pnpm"
1316
},
1417
"dependencies": {
15-
"astro": "5.1.7",
16-
"@astrojs/mdx": "4.0.6",
17-
"@astrojs/rss": "4.0.11",
18-
"@astrojs/sitemap": "3.2.1"
18+
"@astrojs/check": "^0.9.4",
19+
"@astrojs/rss": "^4.0.11",
20+
"@astrojs/sitemap": "^3.2.1",
21+
"@astrojs/svelte": "7.0.3",
22+
"@astrojs/tailwind": "^5.1.4",
23+
"@fontsource-variable/jetbrains-mono": "^5.1.1",
24+
"@fontsource/roboto": "^5.1.0",
25+
"@iconify-json/fa6-brands": "^1.2.3",
26+
"@iconify-json/fa6-regular": "^1.2.2",
27+
"@iconify-json/fa6-solid": "^1.2.2",
28+
"@iconify-json/material-symbols": "^1.2.8",
29+
"@iconify/svelte": "^4.0.2",
30+
"@swup/astro": "^1.5.0",
31+
"@tailwindcss/typography": "^0.5.15",
32+
"astro": "5.1.6",
33+
"astro-compress": "^2.3.5",
34+
"astro-icon": "^1.1.4",
35+
"hastscript": "^9.0.0",
36+
"katex": "^0.16.19",
37+
"markdown-it": "^14.1.0",
38+
"mdast-util-to-string": "^4.0.0",
39+
"overlayscrollbars": "^2.10.1",
40+
"pagefind": "^1.2.0",
41+
"photoswipe": "^5.4.4",
42+
"reading-time": "^1.5.0",
43+
"rehype-autolink-headings": "^7.1.0",
44+
"rehype-components": "^0.3.0",
45+
"rehype-katex": "^7.0.1",
46+
"rehype-slug": "^6.0.0",
47+
"remark-directive": "^3.0.0",
48+
"remark-directive-rehype": "^0.4.2",
49+
"remark-github-admonitions-to-directives": "^1.0.5",
50+
"remark-math": "^6.0.0",
51+
"remark-sectionize": "^2.0.0",
52+
"sanitize-html": "^2.13.1",
53+
"sharp": "^0.33.5",
54+
"stylus": "^0.63.0",
55+
"svelte": "^5.5.3",
56+
"tailwindcss": "^3.4.16",
57+
"typescript": "^5.7.2",
58+
"unist-util-visit": "^5.0.0"
1959
},
2060
"devDependencies": {
21-
"@biomejs/biome": "1.9.4"
22-
}
61+
"@astrojs/ts-plugin": "^1.10.4",
62+
"@biomejs/biome": "1.8.3",
63+
"@rollup/plugin-yaml": "^4.1.2",
64+
"@types/markdown-it": "^14.1.2",
65+
"@types/mdast": "^4.0.4",
66+
"@types/sanitize-html": "^2.13.0",
67+
"postcss-import": "^16.1.0",
68+
"postcss-nesting": "^13.0.1"
69+
},
70+
"packageManager": "pnpm@9.14.4"
2371
}

0 commit comments

Comments
 (0)