From 3db3ef5a56ad8640c6a13cb0775a3fe2645a02a5 Mon Sep 17 00:00:00 2001 From: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:00:59 -0300 Subject: [PATCH] Move docs to VitePress. --- .github/workflows/docs.yml | 69 + .github/workflows/tests.yml | 5 +- client/src/components/HomeHeader.vue | 9 +- .../dashboard/DashboardAsideMenu.vue | 23 +- client/src/composables/useTailwindTheme.ts | 25 +- client/vite.config.ts | 3 - docs/.vitepress/cache/deps/_metadata.json | 52 + docs/.vitepress/cache/deps/chunk-27BHTSA2.js | 8952 ++++++++++++ .../cache/deps/chunk-27BHTSA2.js.map | 7 + docs/.vitepress/cache/deps/chunk-YP6MUCOV.js | 11367 ++++++++++++++++ .../cache/deps/chunk-YP6MUCOV.js.map | 7 + docs/.vitepress/cache/deps/package.json | 3 + .../deps/vitepress___@vue_devtools-api.js | 162 + .../deps/vitepress___@vue_devtools-api.js.map | 7 + .../cache/deps/vitepress___@vueuse_core.js | 563 + .../deps/vitepress___@vueuse_core.js.map | 7 + ...ess___@vueuse_integrations_useFocusTrap.js | 1093 ++ ...__@vueuse_integrations_useFocusTrap.js.map | 7 + .../vitepress___mark__js_src_vanilla__js.js | 1665 +++ ...itepress___mark__js_src_vanilla__js.js.map | 7 + .../cache/deps/vitepress___minisearch.js | 1856 +++ .../cache/deps/vitepress___minisearch.js.map | 7 + docs/.vitepress/cache/deps/vue.js | 323 + docs/.vitepress/cache/deps/vue.js.map | 7 + docs/.vitepress/config.mts | 154 + docs/.vitepress/theme/index.ts | 6 + docs/.vitepress/theme/style.css | 60 + docs/eslint.config.js | 28 + docs/package.json | 24 + docs/pnpm-lock.yaml | 3320 +++++ .../1.about.md => src/general/about.md} | 8 +- .../general/accessibility.md} | 10 +- .../general/privacy-policy.md} | 8 +- .../general/terms-of-use.md} | 8 +- .../guides/instructions.md} | 24 +- .../guides/searching.md} | 8 +- .../3.sharing.md => src/guides/sharing.md} | 8 +- docs/src/index.md | 24 + .../1.about.md => src/pt/general/about.md} | 8 +- .../pt/general/accessibility.md} | 8 +- .../pt/general/privacy-policy.md} | 8 +- .../pt/general/terms-of-use.md} | 8 +- .../pt/guides/instructions.md} | 22 +- .../pt/guides/searching.md} | 8 +- .../3.sharing.md => src/pt/guides/sharing.md} | 8 +- docs/src/pt/index.md | 24 + .../src/public/images}/new-book-step-01.jpg | Bin .../src/public/images}/new-book-step-02.jpg | Bin .../src/public/images}/new-book-step-03.jpg | Bin .../src/public/images}/new-book-step-04.jpg | Bin .../src/public/images}/new-book-step-05.jpg | Bin .../src/public/images}/new-book-step-06.jpg | Bin .../src/public/images}/new-book-step-07.jpg | Bin docs/src/public/logo.svg | 3 + 54 files changed, 29876 insertions(+), 137 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/.vitepress/cache/deps/_metadata.json create mode 100644 docs/.vitepress/cache/deps/chunk-27BHTSA2.js create mode 100644 docs/.vitepress/cache/deps/chunk-27BHTSA2.js.map create mode 100644 docs/.vitepress/cache/deps/chunk-YP6MUCOV.js create mode 100644 docs/.vitepress/cache/deps/chunk-YP6MUCOV.js.map create mode 100644 docs/.vitepress/cache/deps/package.json create mode 100644 docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js create mode 100644 docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map create mode 100644 docs/.vitepress/cache/deps/vitepress___@vueuse_core.js create mode 100644 docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map create mode 100644 docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js create mode 100644 docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map create mode 100644 docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js create mode 100644 docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map create mode 100644 docs/.vitepress/cache/deps/vitepress___minisearch.js create mode 100644 docs/.vitepress/cache/deps/vitepress___minisearch.js.map create mode 100644 docs/.vitepress/cache/deps/vue.js create mode 100644 docs/.vitepress/cache/deps/vue.js.map create mode 100644 docs/.vitepress/config.mts create mode 100644 docs/.vitepress/theme/index.ts create mode 100644 docs/.vitepress/theme/style.css create mode 100644 docs/eslint.config.js create mode 100644 docs/package.json create mode 100644 docs/pnpm-lock.yaml rename docs/{en-US/2.general/1.about.md => src/general/about.md} (97%) rename docs/{en-US/2.general/2.accessibility.md => src/general/accessibility.md} (96%) rename docs/{en-US/2.general/3.privacy-policy.md => src/general/privacy-policy.md} (98%) rename docs/{en-US/2.general/4.terms-of-use.md => src/general/terms-of-use.md} (94%) rename docs/{en-US/1.guide/1.instructions.md => src/guides/instructions.md} (90%) rename docs/{en-US/1.guide/2.searching.md => src/guides/searching.md} (98%) rename docs/{en-US/1.guide/3.sharing.md => src/guides/sharing.md} (94%) create mode 100644 docs/src/index.md rename docs/{pt-BR/2.general/1.about.md => src/pt/general/about.md} (97%) rename docs/{pt-BR/2.general/2.accessibility.md => src/pt/general/accessibility.md} (97%) rename docs/{pt-BR/2.general/3.privacy-policy.md => src/pt/general/privacy-policy.md} (98%) rename docs/{pt-BR/2.general/4.terms-of-use.md => src/pt/general/terms-of-use.md} (94%) rename docs/{pt-BR/1.guide/1.instructions.md => src/pt/guides/instructions.md} (90%) rename docs/{pt-BR/1.guide/2.searching.md => src/pt/guides/searching.md} (98%) rename docs/{pt-BR/1.guide/3.sharing.md => src/pt/guides/sharing.md} (95%) create mode 100644 docs/src/pt/index.md rename {client/src/assets/about => docs/src/public/images}/new-book-step-01.jpg (100%) rename {client/src/assets/about => docs/src/public/images}/new-book-step-02.jpg (100%) rename {client/src/assets/about => docs/src/public/images}/new-book-step-03.jpg (100%) rename {client/src/assets/about => docs/src/public/images}/new-book-step-04.jpg (100%) rename {client/src/assets/about => docs/src/public/images}/new-book-step-05.jpg (100%) rename {client/src/assets/about => docs/src/public/images}/new-book-step-06.jpg (100%) rename {client/src/assets/about => docs/src/public/images}/new-book-step-07.jpg (100%) create mode 100644 docs/src/public/logo.svg diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..05850558 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,69 @@ +name: Deploy docs site to Pages + +on: + push: + branches: + - main + paths: + - 'docs/**' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + run_install: false + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-docs-pnpm-store-${{ hashFiles('**/docs/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-docs-pnpm-store- + - name: Install dependencies + working-directory: docs + run: pnpm install + - name: Run build + working-directory: docs + run: pnpm docs:build + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0337c033..b83d5f74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,10 +6,13 @@ on: - main - stable paths-ignore: - - '**.md' + - 'docs/**' pull_request: branches: - main + paths-ignore: + - 'docs/**' + workflow_dispatch: jobs: build: diff --git a/client/src/components/HomeHeader.vue b/client/src/components/HomeHeader.vue index 7d2b4f2e..0229ee04 100644 --- a/client/src/components/HomeHeader.vue +++ b/client/src/components/HomeHeader.vue @@ -6,7 +6,12 @@ const authStore = useAuthStore() const authenticated = computed(() => authStore.authenticated) const authorized = computed(() => authStore.authorized) -const { t } = useI18n({ useScope: 'global' }) +const { t, locale } = useI18n({ useScope: 'global' }) + +const instructionsLink = computed(() => { + const localePath = locale.value === 'pt-BR' ? 'pt/' : '' + return `https://alessandrojean.github.io/toshokan/${localePath}guides/instructions` +})