Code Monkey home page Code Monkey logo

Comments (3)

HxSay avatar HxSay commented on May 24, 2024

//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.

HxSay avatar HxSay commented on May 24, 2024

//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.

TheOtterlord avatar TheOtterlord commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.