From 3298f69875a66fde8832eeda28f13dc831d51d14 Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Wed, 3 Jan 2024 19:55:10 +0800 Subject: [PATCH] add last-changed preprocessor --- .github/workflows/pages.yml | 4 +++- book.toml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 60d0788..4ae0808 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -38,7 +38,9 @@ jobs: uses: actions/configure-pages@v4 - run: | - cargo install mdbook-last-changed + if ! command -v mdbook-last-changed; then + cargo install mdbook-last-changed + fi mdbook build - name: Upload artifact diff --git a/book.toml b/book.toml index 23604bf..9a3985a 100644 --- a/book.toml +++ b/book.toml @@ -19,3 +19,7 @@ page-break = true # insert page-break after each chapter [output.html.search] enable = true + +[preprocessor.last-changed] +command = "mdbook-last-changed" +renderer = ["html"] \ No newline at end of file