Closed HxSay closed 7 months ago
//astro.config.mjs import { defineConfig } from "astro/config"; import tailwind from "@astrojs/tailwind"; import react from "@astrojs/react"; import partytown from "@astrojs/partytown"; import sitemap from "@astrojs/sitemap"; import remarkGfm from "remark-gfm"; import remarkBreaks from "remark-breaks"; import rehypeSlug from "rehype-slug"; import rehypeAutolinkHeadings from "rehype-autolink-headings";
// https://astro.build/config export default defineConfig({ site: "https://genexu.github.io", integrations: [ tailwind(), react(), partytown({ config: { forward: ["dataLayer.push"], }, }), sitemap({ i18n: { defaultLocale: "zh-tw", locales: { "zh-tw": "zh-TW", en: "en-US", }, }, }), ], markdown: { // https://docs.astro.build/en/guides/markdown-content/#markdown-plugins // https://docs.astro.build/en/guides/markdown-content/#customizing-a-plugin remarkPlugins: [remarkGfm, remarkBreaks], rehypePlugins: [ rehypeSlug, [ rehypeAutolinkHeadings, { behavior: "append", properties: { className: ["anchor"], }, content: { type: "element", tagName: "span", // properties: { // className: ["icon", "icon-link"], // }, children: [ { type: "text", value: "#", }, ], }, }, ], ], shikiConfig: { // Choose from Shiki's built-in themes (or add your own) // https://github.com/shikijs/shiki/blob/main/docs/themes.md theme: "dracula", // Add custom languages // Note: Shiki has countless langs built-in, including .astro! // https://github.com/shikijs/shiki/blob/main/docs/languages.md langs: [], // Enable word wrap to prevent horizontal scrolling wrap: false, }, }, vite: { ssr: { noExternal: ["react-icons"], }, }, });
//gitpages.yml
name: Deploy Astro site to Pages
on: push: branches: ["main"]
workflow_dispatch:
permissions: contents: read pages: write # To deploy to Pages id-token: write # To verify the deployment originates from an appropriate source
concurrency: group: "pages" cancel-in-progress: false
env: BUILD_PATH: "."
jobs: build: name: Build runs-on: ubuntu-latest steps:
name: Checkout uses: actions/checkout@v4
name: Setup Node uses: actions/setup-node@v3 with: node-version: "18" cache: "yarn" cache-dependency-path: ${{ env.BUILD_PATH }}/yarn.lock
name: Setup Pages id: pages uses: actions/configure-pages@v3
name: Clear Yarn cache run: yarn cache clean
name: Install dependencies working-directory: ${{ env.BUILD_PATH }} run: yarn install
name: Build with Astro working-directory: ${{ env.BUILD_PATH }} run: | yarn build \ --site "${{ steps.pages.outputs.origin }}" \ --base "${{ steps.pages.outputs.base_path }}" \ --target es2023 yarn pagefind
name: Upload artifact uses: actions/upload-pages-artifact@v2 with: path: ${{ env.BUILD_PATH }}/dist
deploy: name: Deploy needs: build runs-on: ubuntu-latest
environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}
steps:
name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2
Welcome to docs @HxSay!
If you're having issues with GitHub pages, the best place to get help is the Astro Discord. If you've found something broken specifically with the documentation, filling out our issue template helps let us know exactly what's wrong. I'll close this issue as is for now as there's nothing to act on.
error Top-level await is not available in the configured target environment ("es2020") File: dist/chunks/pages/记一次Java项目线上线程耗尽的问题排查.md.3257850c.mjs:11:35 Code: 1635 | }).join("");
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Process completed with exit code 1.