Skip to content

Commit

Permalink
Added MkDocs integration with GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Apr 7, 2024
1 parent af0f43f commit 35ab39c
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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")"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/venv/
/mkdocs-docs/
/mkdocs-site/
2 changes: 0 additions & 2 deletions _config.yml

This file was deleted.

73 changes: 73 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 35ab39c

Please sign in to comment.