-
Notifications
You must be signed in to change notification settings - Fork 40
refactor: migrating to zine #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b9db10e
refactor: migrating to zine
xihale 32d5192
style: code font size & background
xihale e7b1719
style: code line-height
xihale 34a5ef8
style: toc list-style
xihale 74d58c7
chore
xihale 9a4ea23
style: update body line-height and font size, adjust h1 margin and ad…
xihale 2236390
fix: render toc from md file(Close https://github.com/zigcc/zig-cookb…
xihale cb9992e
fix: update host URL format in zine configuration
xihale f22eeb2
docs: update website generation details and acknowledge zine-ssg as t…
xihale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#documentation | ||
examples/* -linguist-documentation | ||
examples/* -linguist-documentation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,57 @@ | ||
name: Pages | ||
name: Github Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
branches: ["zine", "main"] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup mdBook | ||
uses: peaceiris/actions-mdbook@v1 | ||
fetch-depth: 0 # Change if you need git info | ||
- name: Setup Zine | ||
uses: kristoff-it/setup-zine@v1 | ||
with: | ||
mdbook-version: "latest" | ||
- name: Cache Cargo | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin | ||
key: pages-${{ runner.os }} | ||
- run: | | ||
if ! command -v mdbook-last-changed; then | ||
cargo install mdbook-last-changed | ||
fi | ||
mdbook build | ||
version: v0.10.2 | ||
|
||
- name: Build | ||
run: zine release | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./book | ||
path: "public" | ||
|
||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
uses: actions/deploy-pages@v4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
book | ||
public/ | ||
zig-out/ | ||
zig-cache/ | ||
.zig-cache/ | ||
.DS_Store | ||
.tool-versions | ||
.vscode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ endif | |
|
||
.PHONY: serve | ||
serve: | ||
mdbook serve | ||
zine | ||
|
||
.PHONY: lint | ||
lint: | ||
npx [email protected] --write book-src | ||
npx [email protected] --write src | ||
|
||
.PHONY: run | ||
run: | ||
|
@@ -35,5 +35,5 @@ EXCLUDE = --exclude "*webp" --exclude "*svg" --exclude "*gif" | |
|
||
.PHONY: webp | ||
webp: | ||
fd -t f $(EXCLUDE) --full-path './book-src/images' --exec convert {} {.}.webp \; | ||
fd -t f $(EXCLUDE) --full-path './book-src/images' --exec rm {} \; | ||
fd -t f $(EXCLUDE) --full-path './assets/images' --exec convert {} {.}.webp \; | ||
fd -t f $(EXCLUDE) --full-path './assets/images' --exec rm {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
:root { | ||
--code-fg: #BD976A; | ||
--keyword: #4D9375; | ||
--variable: #BD976A; | ||
--comment: #758575DD; | ||
--operator: #666666; | ||
--string: #C98A7D; | ||
--number: #4C9A91; | ||
--function: #CB7676; | ||
--bracket: #93aa9e; | ||
} | ||
|
||
code { | ||
color: var(--code-fg); | ||
} | ||
|
||
code.zig, code.javascript, code.c, code.cpp, code.zon, code.go{ | ||
color: var(--code-fg); | ||
.keyword, .keyword_modifier, .type_builtin, .keyword_type, .keyword_return, .keyword_conditional, .keyword_repeat, .keyword_operator, .constant_builtin, .keyword_exception, .type{ | ||
color: var(--keyword); | ||
} | ||
.variable, .function_builtin{ | ||
color: var(--variable); | ||
} | ||
.comment{ | ||
color: var(--comment); | ||
} | ||
.operator, .punctuation{ | ||
color: var(--operator); | ||
} | ||
.string, .character{ | ||
color: var(--string); | ||
} | ||
.number{ | ||
color: var(--number); | ||
} | ||
.keyword_function, .punctuation_delimiter, .function{ | ||
color: var(--function); | ||
} | ||
.punctuation_bracket{ | ||
color: var(--bracket); | ||
} | ||
} | ||
|
||
code.conf{ | ||
color: var(--code-fg); | ||
.function{ | ||
color: var(--function); | ||
} | ||
.punctuation_bracket{ | ||
color: var(--bracket); | ||
} | ||
} | ||
|
||
code.diff{ | ||
color: var(--code-fg); | ||
.addition, .string{ | ||
color: #4D9375; | ||
} | ||
.deletion, .keyword{ | ||
color: #CB7676; | ||
} | ||
} | ||
|
||
/* TODO 分词器太烂了 */ | ||
code.bash { | ||
color: var(--code-fg); | ||
.comment { | ||
color: var(--comment); | ||
font-style: italic; | ||
} | ||
span.operator { | ||
color: var(--operator); | ||
} | ||
.constant { | ||
color: var(--number); | ||
} | ||
.string { | ||
color: var(--string); | ||
} | ||
.function { | ||
color: var(--function); | ||
} | ||
} | ||
|
||
code.json{ | ||
color: var(--code-fg); | ||
.constant_builtin{ | ||
color: var(--keyword); | ||
} | ||
span.string_special_key{ | ||
color: var(--string) | ||
} | ||
.string{ | ||
color: var(--function) | ||
} | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
code{ | ||
filter: brightness(0.8) contrast(1.5); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.