Skip to content

Commit

Permalink
pages: add last changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Jan 2, 2024
1 parent 963cecd commit e4aa67a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- run: mdbook build
- run: |
cargo install mdbook-last-changed
mdbook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ title = "Zig cookbook"
git-repository-url = "https://github.com/zigcc/zig-cookbook"
edit-url-template = "https://github.com/zigcc/zig-cookbook/edit/main/{path}"
additional-js = ["static/zig-hl.js"]
additional-css = ["static/last-changed.css"]
site-url = "zig-cookbook"

[preprocessor.last-changed]
command = "mdbook-last-changed"
renderer = ["html"]
6 changes: 6 additions & 0 deletions static/last-changed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
footer {
font-size: 0.8em;
text-align: center;
border-top: 1px solid black;
padding: 5px 0;
}

0 comments on commit e4aa67a

Please sign in to comment.