diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..e203a51 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,35 @@ +name: CI - Build + +on: + push: + branches: [main] + pull_request: + +concurrency: + group: ci-build-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + workspace: + name: Build workspace + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + submodules: recursive + + - uses: j178/prek-action@v3.0.0 + with: + install-only: true + + - uses: voidzero-dev/setup-vp@v1 + with: + cache: true + run-install: | + args: ["--frozen-lockfile"] + + - name: Build all sites + run: vp run build diff --git a/.github/workflows/ci-links.yml b/.github/workflows/ci-links.yml index e0e3077..a6394d0 100644 --- a/.github/workflows/ci-links.yml +++ b/.github/workflows/ci-links.yml @@ -9,8 +9,6 @@ on: - "README.md" - ".github/workflows/ci-links.yml" pull_request: - branches: - - main paths: - "AGENTS.md" - "README.md" diff --git a/.github/workflows/ci-static-checks.yml b/.github/workflows/ci-static-checks.yml index 307d042..756420c 100644 --- a/.github/workflows/ci-static-checks.yml +++ b/.github/workflows/ci-static-checks.yml @@ -5,8 +5,6 @@ on: branches: - main pull_request: - branches: - - main concurrency: group: ci-static-${{ github.ref }} diff --git a/.github/workflows/ci-typos.yml b/.github/workflows/ci-typos.yml index e9d8cb2..68b38bf 100644 --- a/.github/workflows/ci-typos.yml +++ b/.github/workflows/ci-typos.yml @@ -12,8 +12,6 @@ on: - "README.md" - "apps/blog/data/blog/**" pull_request: - branches: - - main paths: - ".github/**" - ".vale.ini" diff --git a/.github/workflows/ci-vale.yml b/.github/workflows/ci-vale.yml index 8c52ff7..8b6d6e4 100644 --- a/.github/workflows/ci-vale.yml +++ b/.github/workflows/ci-vale.yml @@ -11,8 +11,6 @@ on: - "hosting" - "hosting/**/*.md" pull_request: - branches: - - main paths: - ".vale.ini" - ".github/styles/**" diff --git a/apps/blog/astro.config.mjs b/apps/blog/astro.config.mjs index e709ee9..31cfeef 100644 --- a/apps/blog/astro.config.mjs +++ b/apps/blog/astro.config.mjs @@ -51,6 +51,16 @@ export default defineConfig({ typst({ options: { remPx: 14, + cheerio: { + postprocess($, source) { + if ($("svg").length === 0) { + throw new Error( + `Typst produced no SVG for ${source.mainFilePath}. Check the compiler diagnostics above.` + ); + } + return $; + }, + }, }, target: id => { if (id.includes("/data/")) return "html"; diff --git a/apps/blog/data/blog/_language/egglog-quickstart-02.md b/apps/blog/data/blog/_language/egglog-quickstart-02.md index 080fec7..5872ebb 100644 --- a/apps/blog/data/blog/_language/egglog-quickstart-02.md +++ b/apps/blog/data/blog/_language/egglog-quickstart-02.md @@ -7,7 +7,7 @@ modDatetime: 2026-02-15 tags: ["编译/IR", "E-graph", "egg", "egglog", "等价饱和", "Term Rewriting"] --- -[第一篇](egglog-quickstart-01) 用 Peano 构造和纯重写规则定义了自然数的加法与乘法。本文从自然数出发,**逐步扩展**到整数与有理数,在此过程中展示 `constructor` 扩展、`rule`、`:when`、`relation`、`birewrite` 等 egglog 特性。第三篇将介绍内置类型,并以复数为例展示其应用。 +[第一篇](/posts/egglog-quickstart-01/) 用 Peano 构造和纯重写规则定义了自然数的加法与乘法。本文从自然数出发,**逐步扩展**到整数与有理数,在此过程中展示 `constructor` 扩展、`rule`、`:when`、`relation`、`birewrite` 等 egglog 特性。第三篇将介绍内置类型,并以复数为例展示其应用。 ## 从自然数到整数:引入 Neg diff --git a/apps/blog/data/blog/_language/egglog-quickstart-03.md b/apps/blog/data/blog/_language/egglog-quickstart-03.md index 7fdbba3..a6764cc 100644 --- a/apps/blog/data/blog/_language/egglog-quickstart-03.md +++ b/apps/blog/data/blog/_language/egglog-quickstart-03.md @@ -7,7 +7,7 @@ modDatetime: 2026-02-17 tags: ["编译/IR", "E-graph", "egg", "egglog", "等价饱和", "Term Rewriting"] --- -[第二篇](egglog-quickstart-02) 用纯构造从自然数扩展到整数、有理数与实数。本文**承接第二篇**:先用已有类型定义复数及其运算,再介绍 egglog 的**内置类型**,并展示如何用它们实现高效运算。 +[第二篇](/posts/egglog-quickstart-02/) 用纯构造从自然数扩展到整数、有理数与实数。本文**承接第二篇**:先用已有类型定义复数及其运算,再介绍 egglog 的**内置类型**,并展示如何用它们实现高效运算。 ## 复数的纯构造定义