Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Jan 23, 2022
0 parents commit cf9f415
Show file tree
Hide file tree
Showing 13 changed files with 1,472 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: github pages

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'

- name: Setup mdbook-theme latest
run: |
curl -s https://api.github.com/repos/zjp-CN/mdbook-theme/releases/latest \
| grep browser_download_url \
| grep mdbook-theme_linux \
| cut -d '"' -f 4 \
| wget -qi -
tar -xvzf mdbook-theme_linux.tar.gz
echo $PWD >> $GITHUB_PATH
- run: mdbook build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 ZJPzjp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# mdbook-template

Yield a mdbook demo with [mdbook-theme](https://github.com/zjp-CN/mdbook-theme)
and a yml file for github action automation and page publication.

You just need to creat md files in `src/` dir, then add the filenames in `SUMMARY.md`,
and everything is ready to go.

But for the first time after pushing to github, set the source of github page to
`gh-pages` branch and `/(root)` in `Settings`.

Have fun with mdbook!

30 changes: 30 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[book]
authors = ["zjp <[email protected]>"]
language = "zh"
multilingual = false
src = "src"
title = "book-name"

[preprocessor.theme]
pagetoc = true
sidebar-width = "250px"

[output.html]
default-theme = "ayu"
git-repository-url = ""
additional-css = ["theme/pagetoc.css"]
additional-js = ["theme/pagetoc.js"]

[output.html.fold]
enable = false
level = 1

[output.html.playground]
editable = true

[output.html.print]
enable = false

[output.theme-ace]
theme-white = "xcode"
theme-dark = "monokai"
3 changes: 3 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Summary

- [Chapter 1](./chapter_1.md)
1 change: 1 addition & 0 deletions src/chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chapter 1
Loading

0 comments on commit cf9f415

Please sign in to comment.