Comments (3)
//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"],
},
},
});
from docs.
//gitpages.yml
name: Deploy Astro site to Pages
on:
push:
branches: ["main"]
Allows run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
pages: write # To deploy to Pages
id-token: write # To verify the deployment originates from an appropriate source
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
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
from docs.
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.
from docs.
Related Issues (20)
- ci: Upgrade `pnpm/setup-action` GitHub Action
- Missing description of different results of `paginate()` when using rest parameter in file-based routing HOT 2
- Unable to add icons to external links HOT 2
- After "npm create @keystatic@latest", "npm run build" fails HOT 1
- following your Docker setup by the letter ends in error HOT 1
- [astro-rss] [tutorial] [docs] --- Blog-tutorial breaks on step 5.4 --- '@astrojs/rss' No API Route handler exists for the method "GET" for the route "/rss.xml". HOT 1
- Outdated caution warning? HOT 1
- ⚠️ Issue Sample code for 'Building for static output (default)' throws a "Property 'render' does not exist on type 'never'" HOT 1
- Suggestion to improve the docs for the Code component HOT 1
- Clarify how to add images to RSS HOT 4
- No yarn version information HOT 1
- Clarify reference to Astro.currentLocale in guides/internationalization.mdx? HOT 2
- Astro Dev Server Errors when Dynamically Importing Images - Missing Image Dimensions & Unable to Retrieve Remote Image Dimensions HOT 1
- Incomplete or unclear guide for custom MDX components
- Confusing hybrid mode on Cookie HOT 4
- `@astrojs/db` NPM page links to nonexistent documentation page HOT 2
- Missing: Rendering content to HTML for `getCollection`
- Show how to merge classes passed as props when children have existing classes HOT 1
- Meta Docs related repos do not have LICENSE files
- MDX code example in the Layouts section does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.