From 26de00c803bb060e55128b046794a8c92c724afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=9F=A5=E7=81=AB=20Shiranui?= Date: Tue, 24 Sep 2024 12:51:41 +0800 Subject: [PATCH] feat: init --- .github/workflows/docs.yml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 22 ++++++++++++++++++++++ README.md | 1 + docs/.vitepress/config.mts | 16 ++++++++++++++++ docs/index.md | 8 ++++++++ package.json | 10 ++++++++++ 6 files changed, 89 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 docs/.vitepress/config.mts create mode 100644 docs/index.md create mode 100644 package.json diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..5fae3b3 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +name: Docs workflow + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + build-and-deploy-docs: + runs-on: ubuntu-latest + steps: + - name: Specific Node.js version 🦄 + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Checkout 🛎️ + uses: actions/checkout@v4 + + - name: Install and Build 📎 + run: | + npm install + npm run docs:build + + - name: Deploy Docs 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: docs/.vitepress/dist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3616eac --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +.DS_Store +node_modules +docs/.vitepress/dist +docs/.vitepress/cache + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# Lock file +package-lock.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..d953a62 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Wiki diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts new file mode 100644 index 0000000..5d7a08e --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,16 @@ +import { defineConfig } from 'vitepress' + +const isProduction = process.env.NODE_ENV === 'production' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "Wiki", + base: isProduction ? "/wiki/" : "/", + description: "Taiwan Web Technology Promotion Organization", + themeConfig: { + // https://vitepress.dev/reference/default-theme-config + nav: [ + { text: 'Home', link: '/' }, + ], + } +}) diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..ee86316 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,8 @@ +--- +layout: home + +hero: + name: Wiki + tagline: Taiwan Web Technology Promotion Organization +--- + diff --git a/package.json b/package.json new file mode 100644 index 0000000..d7e5a5a --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "scripts": { + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs" + }, + "devDependencies": { + "vitepress": "^1.3.4" + } +}