Skip to content

Commit

Permalink
mkdocs, make it simple, make it work
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Dec 7, 2023
1 parent c0a2721 commit 0f9f632
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions
name: Build docs page
on:
push:
branches:
- master
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install -r docs/requirements.txt
- run: mkdocs gh-deploy --force
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ __pycache__
*.mcdr
*.pyz
/run

# docs
/site/
1 change: 1 addition & 0 deletions docs/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default english example
1 change: 1 addition & 0 deletions docs/example.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
中文example
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdocs
mkdocs-material
mkdocs-static-i18n[material]
40 changes: 40 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://www.mkdocs.org/
site_name: Prime Backup Documents
site_url: https://tisunion.github.io/PrimeBackup/
site_author: Fallen_Breath
site_description: A powerful backup plugin for MCDR, an advanced backup solution for your Minecraft world
repo_url: https://github.com/TISUnion/PrimeBackup
copyright: Copyright © 2023 Fallen_Breath
exclude_docs: |-
/requirements.txt
theme:
name: material
# https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference
plugins:
- search
- i18n:
# https://ultrabug.github.io/mkdocs-static-i18n/getting-started/quick-start/#configure-the-plugin-in-your-mkdocsyml
docs_structure: suffix
languages:
- locale: en
default: true
name: English
build: true
- locale: zh
name: 简体中文
build: true

0 comments on commit 0f9f632

Please sign in to comment.