From 35ab39c017d7a1cc7b450c7949a5cb7a5fd63836 Mon Sep 17 00:00:00 2001 From: dmotte <37443982+dmotte@users.noreply.github.com> Date: Sun, 7 Apr 2024 18:11:12 +0200 Subject: [PATCH] Added MkDocs integration with GitHub Pages --- .github/workflows/main.yml | 20 +++++++++++ .gitignore | 3 ++ _config.yml | 2 -- mkdocs.yml | 73 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 .gitignore delete mode 100644 _config.yml create mode 100644 mkdocs.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f752e3d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,20 @@ +--- +name: main + +on: + push: # All branches and tags + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + job: + permissions: { id-token: write, pages: write } + uses: dmotte/misc/.github/workflows/cicd-with-script.yml@main + with: + script: > + MKDOCS_DEPS=mkdocs-material,mkdocs-minify-plugin,pymdown-extensions + MKDOCS_DOCS_SRC=. MKDOCS_DOCS_DST=mkdocs-docs + MKDOCS_DOCS_EXCLUDES=.git,venv,mkdocs-docs,mkdocs-site + MKDOCS_SITE_DIR=mkdocs-site + bash "$(realpath "$GITHUB_ACTION_PATH/../../scripts/cicd/mkdocs-ghpages.sh")" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe4c631 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/venv/ +/mkdocs-docs/ +/mkdocs-site/ diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 72096de..0000000 --- a/_config.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -theme: jekyll-theme-cayman diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..dfd0d9a --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,73 @@ +--- +strict: true +docs_dir: !ENV MKDOCS_DOCS_DST +site_dir: !ENV MKDOCS_SITE_DIR + +# Inspired by https://github.com/dmotte/misc/blob/main/mkdocs.yml + +site_name: KnowledgeBass +site_url: https://violinminds.github.io/knowledgebass/ +site_author: violinminds +site_description: Errare humanvm est, perseverare is like breadcrumbs on top of pasta. + +repo_name: violinminds/knowledgebass +repo_url: https://github.com/violinminds/knowledgebass +edit_uri: blob/main + +theme: + name: material + features: + - content.action.edit + - content.action.view + - content.code.copy + - content.tooltips + - navigation.tabs + - navigation.indexes # Provides same behavior as the "mkdocs-section-index" plugin + - navigation.expand + - navigation.footer + - navigation.top + - search.share + - search.suggest + - search.highlight + palette: + - media: "(prefers-color-scheme)" + toggle: + icon: material/link + name: Switch to light mode + - media: "(prefers-color-scheme: light)" + scheme: default + primary: indigo + accent: indigo + toggle: + icon: material/toggle-switch + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: black + accent: indigo + toggle: + icon: material/toggle-switch-off + name: Switch to system preference + # favicon: null + icon: { logo: material/music-clef-bass } + +plugins: + - minify: { minify_html: true } + - search + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/violinminds + +markdown_extensions: + - pymdownx.magiclink + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.highlight: + auto_title: true + auto_title_map: { Text Only: "" } + linenums: true + anchor_linenums: true + - pymdownx.superfences