diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b6810d0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,68 @@ +# Sample workflow for building and deploying a VitePress site to GitHub Pages +# +name: Deploy VitePress site to Pages + +on: + # Runs on pushes targeting the `main` branch. Change this to `master` if you're + # using the `master` branch as the default branch. + push: + branches: [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: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Not needed if lastUpdated is not enabled + # - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm + # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: pnpm # or pnpm / yarn + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Install dependencies + run: pnpm install # or pnpm install / yarn install / bun install + - name: Build with VitePress + run: | + pnpm docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build + touch docs/.vitepress/dist/.nojekyll + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: packages/docs/.vitepress/dist + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + outputs: + page_url: "https://ce.ivy-design.press" diff --git a/.gitignore b/.gitignore index 28fdc30..b4c12cc 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ types test-results/ playwright-report/ + +packages/docs/src/.vitepress/.temp/ diff --git a/packages/docs/package.json b/packages/docs/package.json index d8ae12e..412a95b 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -17,6 +17,6 @@ "vue": "^3.3.4" }, "devDependencies": { - "vitepress": "1.0.0-rc.20" + "vitepress": "1.0.0-rc.24" } } diff --git a/packages/docs/src/.vitepress/config.mjs b/packages/docs/src/.vitepress/config.mjs index 6c529b2..5974ec1 100644 --- a/packages/docs/src/.vitepress/config.mjs +++ b/packages/docs/src/.vitepress/config.mjs @@ -10,19 +10,22 @@ export default defineConfig({ nav, sidebar, outline: [2, 3], - outlineTitle: '章节目录', + outlineTitle: "章节目录", socialLinks: [ { icon: "github", link: "https://github.com/vuejs/vitepress" }, ], - search:{ - provider: 'local' - } + search: { + provider: "local", + }, + }, + vue: { + template: { + compilerOptions: { + isCustomElement: (tag) => tag.startsWith("ivy-"), + }, + }, + }, + sitemap: { + hostname: "https://ce.ivy-design.press", }, - vue:{ - template:{ - compilerOptions:{ - isCustomElement: tag => tag.startsWith('ivy-') - } - } - } }); diff --git a/packages/docs/src/.vitepress/theme/index.js b/packages/docs/src/.vitepress/theme/index.js index 280a200..b893866 100644 --- a/packages/docs/src/.vitepress/theme/index.js +++ b/packages/docs/src/.vitepress/theme/index.js @@ -2,8 +2,8 @@ import { h } from "vue"; import Theme from "vitepress/theme"; import "./style.css"; -import { registerComponents } from "@ivy-design/wc"; -import "@ivy-design/wc/dist/style.css"; +import { registerComponents } from "@ivy-design/ce"; +import "@ivy-design/ce/dist/style.css"; export default { ...Theme, @@ -12,8 +12,8 @@ export default { // https://vitepress.dev/guide/extending-default-theme#layout-slots }); }, - enhanceApp({ app, router, siteData }) { + enhanceApp(ctx) { // ... - registerComponents(); + if (ct) registerComponents(); }, }; diff --git a/packages/docs/src/components/clipboard.md b/packages/docs/src/components/clipboard.md index aba45b5..6d48432 100644 --- a/packages/docs/src/components/clipboard.md +++ b/packages/docs/src/components/clipboard.md @@ -43,7 +43,7 @@ ```