From cb48ec12977c369404d88ca291ba6a06a46ac8e2 Mon Sep 17 00:00:00 2001 From: wenzexu Date: Sun, 9 Jun 2024 09:10:50 +1000 Subject: [PATCH] chore: Add CNAME, requirements.txt, extra.css, and index.md files --- .github/workflows/ci.yml | 29 ++++++ docs/CNAME | 1 + docs/assets/favicon-faded-8.svg | 1 + docs/assets/favicon-white-background.svg | 1 + docs/index.md | 17 ++++ docs/stylesheets/extra.css | 8 ++ mkdocs.yml | 117 +++++++++++++++++++++++ requirements.txt | 1 + 8 files changed, 175 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 docs/CNAME create mode 100644 docs/assets/favicon-faded-8.svg create mode 100644 docs/assets/favicon-white-background.svg create mode 100644 docs/index.md create mode 100644 docs/stylesheets/extra.css create mode 100644 mkdocs.yml create mode 100644 requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f7bb467 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: ci +on: + push: + branches: + - master + - main +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@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install -r requirements.txt + - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..9308ed7 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +rhce.ricolxwz.de \ No newline at end of file diff --git a/docs/assets/favicon-faded-8.svg b/docs/assets/favicon-faded-8.svg new file mode 100644 index 0000000..79e2552 --- /dev/null +++ b/docs/assets/favicon-faded-8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/favicon-white-background.svg b/docs/assets/favicon-white-background.svg new file mode 100644 index 0000000..5280187 --- /dev/null +++ b/docs/assets/favicon-white-background.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..000ea34 --- /dev/null +++ b/docs/index.md @@ -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. diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..cff7fed --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,8 @@ +.md-header__button.md-logo { + margin: 0; + padding: 0; + } + .md-header__button.md-logo img, .md-header__button.md-logo svg { + height: 2.5rem; + width: 2.5rem; + } \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..bd3706b --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,117 @@ +site_name: RHCE 笔记 +site_author: ricolxwz +copyright: Copyright © 2024 ricolxwz +site_description: An RHCE study note +repo_url: https://github.com/ricolxwz/rhce +repo_name: ricolxwz/rhce +theme: + name: material + logo: assets/favicon-faded-8.svg + favicon: assets/favicon-white-background.svg + language: zh + features: + - content.code.annotate + - content.code.copy + - content.code.select + - content.tabs.link + - content.footnote.tooltips + # - header.autohide + # - announce.dismiss + # - navigation.footer + - navigation.tabs + - navitation.sections + - navigation.expand + - navigation.indexes + # - navigation.top + - search.suggest + - search.highlight + - search.share + - navigation.tracking + palette: + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + - media: "(prefers-color-scheme: light)" + scheme: default + primary: indigo + accent: indigo + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: black + accent: indigo + toggle: + icon: material/brightness-4 + name: Switch to system preference + icon: + repo: fontawesome/brands/github-alt + admonition: + note: octicons/tag-16 + abstract: octicons/checklist-16 + info: octicons/info-16 + tip: octicons/squirrel-16 + success: octicons/check-16 + question: octicons/question-16 + warning: octicons/alert-16 + failure: octicons/x-circle-16 + danger: octicons/zap-16 + bug: octicons/bug-16 + example: octicons/beaker-16 + quote: octicons/quote-16 +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/ricolxwz + - icon: fontawesome/brands/gitlab + link: https://gitlab.com/ricolxwz + - icon: fontawesome/brands/docker + link: https://hub.docker.com/u/ricolxwz + generator: false +extra_css: + - stylesheets/extra.css + - https://unpkg.com/katex@0/dist/katex.min.css +extra_javascript: + - javascripts/katex.js + - https://unpkg.com/katex@0/dist/katex.min.js + - https://unpkg.com/katex@0/dist/contrib/auto-render.min.js +markdown_extensions: + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences + - pymdownx.details + - pymdownx.critic + - pymdownx.caret + - pymdownx.keys + - pymdownx.mark + - pymdownx.tilde + - pymdownx.magiclink + - admonition + - attr_list + - md_in_html + - footnotes + - def_list + - tables + - pymdownx.arithmatex: + generic: true + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format +plugins: + - search +nav: + - 开始: + - index.md \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..898468c --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +mkdocs-material \ No newline at end of file