From 4ebb00ecf0be6aa0b8ff3e49d40b72f74c460eb6 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Wed, 13 Mar 2024 14:26:25 +1300 Subject: [PATCH 1/3] Update docs styles --- docs/.vitepress/theme/custom.css | 58 ++++++++++++++++++++++++++++++++ docs/.vitepress/theme/index.js | 4 +++ docs/demo.md | 53 +++++++++++++++++++++++------ 3 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 docs/.vitepress/theme/custom.css create mode 100644 docs/.vitepress/theme/index.js diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css new file mode 100644 index 0000000..11b41cb --- /dev/null +++ b/docs/.vitepress/theme/custom.css @@ -0,0 +1,58 @@ +/* Modify content styles for desktop view */ +@media (min-width: 1280px) { + .VPContent .VPDoc.has-aside { + & .content-container { + max-width: none; + } + + .content-container .vp-doc { + & table { + overflow: unset; + } + + & table thead { + position: sticky; + top: 64px; /* navigation height */ + + & th { + background-color: var(--vp-c-gray-1); + } + } + + & table tr { + th, td { + vertical-align: top; + } + + th:first-child, + td:first-child { + width: 10%; + text-wrap: nowrap; + } + + /* Description column */ + th:nth-child(2), + td:nth-child(2) { + width: 40%; + } + + th:nth-child(3), + td:nth-child(3) { + width: 10%; + } + + th:nth-child(4), + td:nth-child(4) { + width: 10%; + } + + th:last-child, + td:last-child { + width: 20%; + word-wrap: break-word; + word-break: break-word; + } + } + } + } +} diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js new file mode 100644 index 0000000..1118b56 --- /dev/null +++ b/docs/.vitepress/theme/index.js @@ -0,0 +1,4 @@ +import DefaultTheme from "vitepress/theme" +import './custom.css' + +export default DefaultTheme diff --git a/docs/demo.md b/docs/demo.md index 31eeb4a..44cc34b 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -1,14 +1,18 @@ -# Live demo +# ScaffoldVuer Demo -
- - - +## Live demo + +
+
+ + + +
+ + ## Code Preview ```js-vue From bf07ebe61954811e164be57c20091193ca64cff5 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Wed, 13 Mar 2024 14:29:20 +1300 Subject: [PATCH 2/3] Add version number in docs --- docs/.vitepress/config.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index ad51c2a..eea976b 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -2,10 +2,14 @@ import { defineConfig } from 'vitepress' import Components from 'unplugin-vue-components/vite' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' +// Version number +const versionNumber = process.env.npm_package_version + // https://vitepress.dev/reference/site-config export default defineConfig({ title: "ScaffoldVuer Docs", description: "API documentation for ScaffoldVuer", + base: '/scaffoldvuer/', themeConfig: { // https://vitepress.dev/reference/default-theme-config nav: [ @@ -20,6 +24,14 @@ export default defineConfig({ { text: 'Live Demo', link: '/demo' }, { text: 'API References', link: '/components/ScaffoldVuer' }, ] + }, + { + text: 'Version', + items: [ + { + text: `${versionNumber}` + } + ] } ], socialLinks: [ @@ -50,7 +62,7 @@ export default defineConfig({ }), ], }), - + // https://github.com/antfu/unocss // see unocss.config.ts for config ] From 5d62b29c39ecdf2372dc0e5ef1734e8c09dc3ee3 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Wed, 13 Mar 2024 14:31:46 +1300 Subject: [PATCH 3/3] Add GitHub deployment workflow for docs --- .github/workflows/deploy-docs.yml | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..8250a22 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,60 @@ +name: Deploy Docs to Pages + +on: + # Runs on pushes targeting the `docs` branch and `main` branch. + push: + branches: ["docs", "main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +# concurrency: +# group: pages +# cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '18.17.1' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build with VitePress + run: | + npm run docs:build + touch docs/.vitepress/dist/.nojekyll + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs/.vitepress/dist + + # Deployment job + 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@v4