diff --git a/biome.jsonc b/biome.jsonc new file mode 100644 index 0000000..d0c298e --- /dev/null +++ b/biome.jsonc @@ -0,0 +1,35 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "ignoreUnknown": false, + "includes": ["src/**/*"] + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + } +} diff --git a/package.json b/package.json index d0e1734..d101e98 100644 --- a/package.json +++ b/package.json @@ -14,5 +14,8 @@ "astro": "^5.16.5", "github-markdown-css": "^5.8.1", "preact": "^10.28.0" + }, + "devDependencies": { + "@biomejs/biome": "2.3.8" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad3d729..2ae49c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,10 @@ preact: specifier: ^10.28.0 version: 10.28.0 + devDependencies: + '@biomejs/biome': + specifier: 2.3.8 + version: 2.3.8 packages: @@ -148,6 +152,59 @@ resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} engines: {node: '>=6.9.0'} + '@biomejs/biome@2.3.8': + resolution: {integrity: sha512-Qjsgoe6FEBxWAUzwFGFrB+1+M8y/y5kwmg5CHac+GSVOdmOIqsAiXM5QMVGZJ1eCUCLlPZtq4aFAQ0eawEUuUA==} + engines: {node: '>=14.21.3'} + hasBin: true + + '@biomejs/cli-darwin-arm64@2.3.8': + resolution: {integrity: sha512-HM4Zg9CGQ3txTPflxD19n8MFPrmUAjaC7PQdLkugeeC0cQ+PiVrd7i09gaBS/11QKsTDBJhVg85CEIK9f50Qww==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + + '@biomejs/cli-darwin-x64@2.3.8': + resolution: {integrity: sha512-lUDQ03D7y/qEao7RgdjWVGCu+BLYadhKTm40HkpJIi6kn8LSv5PAwRlew/DmwP4YZ9ke9XXoTIQDO1vAnbRZlA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + + '@biomejs/cli-linux-arm64-musl@2.3.8': + resolution: {integrity: sha512-PShR4mM0sjksUMyxbyPNMxoKFPVF48fU8Qe8Sfx6w6F42verbwRLbz+QiKNiDPRJwUoMG1nPM50OBL3aOnTevA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-arm64@2.3.8': + resolution: {integrity: sha512-Uo1OJnIkJgSgF+USx970fsM/drtPcQ39I+JO+Fjsaa9ZdCN1oysQmy6oAGbyESlouz+rzEckLTF6DS7cWse95g==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-x64-musl@2.3.8': + resolution: {integrity: sha512-YGLkqU91r1276uwSjiUD/xaVikdxgV1QpsicT0bIA1TaieM6E5ibMZeSyjQ/izBn4tKQthUSsVZacmoJfa3pDA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-linux-x64@2.3.8': + resolution: {integrity: sha512-QDPMD5bQz6qOVb3kiBui0zKZXASLo0NIQ9JVJio5RveBEFgDgsvJFUvZIbMbUZT3T00M/1wdzwWXk4GIh0KaAw==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-win32-arm64@2.3.8': + resolution: {integrity: sha512-H4IoCHvL1fXKDrTALeTKMiE7GGWFAraDwBYFquE/L/5r1927Te0mYIGseXi4F+lrrwhSWbSGt5qPFswNoBaCxg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + + '@biomejs/cli-win32-x64@2.3.8': + resolution: {integrity: sha512-RguzimPoZWtBapfKhKjcWXBVI91tiSprqdBYu7tWhgN8pKRZhw24rFeNZTNf6UiBfjCYCi9eFQs/JzJZIhuK4w==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + '@capsizecss/unpack@3.0.1': resolution: {integrity: sha512-8XqW8xGn++Eqqbz3e9wKuK7mxryeRjs4LOHLxbh2lwKeSbuNR4NFifDZT4KzvjU6HMOPbiNTsWpniK5EJfTWkg==} engines: {node: '>=18'} @@ -2112,6 +2169,41 @@ '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 + '@biomejs/biome@2.3.8': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 2.3.8 + '@biomejs/cli-darwin-x64': 2.3.8 + '@biomejs/cli-linux-arm64': 2.3.8 + '@biomejs/cli-linux-arm64-musl': 2.3.8 + '@biomejs/cli-linux-x64': 2.3.8 + '@biomejs/cli-linux-x64-musl': 2.3.8 + '@biomejs/cli-win32-arm64': 2.3.8 + '@biomejs/cli-win32-x64': 2.3.8 + + '@biomejs/cli-darwin-arm64@2.3.8': + optional: true + + '@biomejs/cli-darwin-x64@2.3.8': + optional: true + + '@biomejs/cli-linux-arm64-musl@2.3.8': + optional: true + + '@biomejs/cli-linux-arm64@2.3.8': + optional: true + + '@biomejs/cli-linux-x64-musl@2.3.8': + optional: true + + '@biomejs/cli-linux-x64@2.3.8': + optional: true + + '@biomejs/cli-win32-arm64@2.3.8': + optional: true + + '@biomejs/cli-win32-x64@2.3.8': + optional: true + '@capsizecss/unpack@3.0.1': dependencies: fontkit: 2.0.4 diff --git a/src/components/Toc.astro b/src/components/Toc.astro new file mode 100644 index 0000000..546005e --- /dev/null +++ b/src/components/Toc.astro @@ -0,0 +1,160 @@ +--- +type PageItem = { + url: string; + title: string; +}; + +type Section = { + title: string; + items: PageItem[]; +}; + +async function getSectionPages(sectionPath: string): Promise { + const allPages = await Astro.glob("../pages/**/*.mdx"); + + return allPages + .filter((page) => page.file.includes(`/pages/${sectionPath}/`)) + .map((page) => { + const fileName = page.file.split("/").pop()?.replace(".mdx", "") || ""; + const url = `/${sectionPath}/${fileName}`; + const title = + page.frontmatter?.title || + fileName.replace(/^\d+-/, "").replace(/-/g, " "); + + return { url, title, order: parseInt(fileName) || 999 }; + }) + .sort((a, b) => a.order - b.order); +} + +const currentPath = Astro.url.pathname; + +const sections: Section[] = []; + +const sectionPaths = ["html", "tips"]; + +for (const path of sectionPaths) { + const pages = await getSectionPages(path); + if (pages.length > 0) { + sections.push({ + title: path.charAt(0).toUpperCase() + path.slice(1), + items: pages, + }); + } +} +--- + + + + diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro index 4a563ab..49d37ab 100644 --- a/src/layouts/MarkdownLayout.astro +++ b/src/layouts/MarkdownLayout.astro @@ -1,15 +1,25 @@ --- import "github-markdown-css"; +import Toc from "../components/Toc.astro"; --- - + + -
- -
+
+
+
+ +
+
+ +
+ +
+
@@ -26,4 +36,24 @@ padding: 15px; } } + .__container { + display: flex; + flex-direction: row; + gap: 24px; + } + .__toc { + flex: 0 0 200px; + } + .__content { + flex: 1 1 auto; + } + @media (max-width: 767px) { + .__container { + flex-direction: column; + } + .__toc { + flex: none; + width: auto; + } + } diff --git a/src/pages/html/0-introduction.mdx b/src/pages/html/0-introduction.mdx new file mode 100644 index 0000000..bf0e8f9 --- /dev/null +++ b/src/pages/html/0-introduction.mdx @@ -0,0 +1,8 @@ +--- +layout: ../../layouts/MarkdownLayout.astro +--- + +import "github-markdown-css"; +import Toc from "../../components/Toc.astro"; + +# HTML Introduction diff --git a/src/pages/tips/terminal.mdx b/src/pages/tips/terminal.mdx new file mode 100644 index 0000000..272cd95 --- /dev/null +++ b/src/pages/tips/terminal.mdx @@ -0,0 +1,5 @@ +--- +layout: ../../layouts/MarkdownLayout.astro +--- + +# 黒い画面