diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml new file mode 100644 index 0000000..6f20493 --- /dev/null +++ b/.github/workflows/docs-pr.yml @@ -0,0 +1,27 @@ +name: Validate documentation build + +on: + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + docs-validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + + - name: Set up Python + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: '3.x' + cache: 'pip' + + - name: Install dependencies + run: make install + + - name: Validate documentation build + run: make build diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3691602 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: help install serve build + +.DEFAULT_GOAL := help + +help: ## Show this help message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' + +install: ## Install documentation dependencies + pip install -r requirements.txt + +serve: install ## Serve documentation locally + mkdocs serve + +build: install ## Build documentation with strict mode + mkdocs build --strict diff --git a/custom_theme/main.html b/custom_theme/main.html index 9591120..0bcfd06 100644 --- a/custom_theme/main.html +++ b/custom_theme/main.html @@ -3,10 +3,10 @@ {% block footer %} {{ super() }}
We are a Cloud Native Computing Foundation sandbox project.
-
-
+
+
+
The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see Trademark Usage.
-OSCAL Compass was originally contributed by IBM.
+OSCAL Compass was originally contributed by IBM.
{% endblock %} diff --git a/docs/.pages b/docs/.pages index b1087aa..220e3b2 100644 --- a/docs/.pages +++ b/docs/.pages @@ -2,3 +2,4 @@ nav: - Welcome to OSCAL Compass: index.md - About OSCAL Compass: about.md - OSCAL Compass Community: community.md + - Trestle Docs: https://oscal-compass.dev/compliance-trestle/ diff --git a/docs/css/extra.css b/docs/css/extra.css new file mode 100644 index 0000000..59327d3 --- /dev/null +++ b/docs/css/extra.css @@ -0,0 +1,7 @@ +/* Show/hide CNCF logo based on active color scheme */ +[data-md-color-scheme="default"] .cncf-logo-dark { + display: none; +} +[data-md-color-scheme="slate"] .cncf-logo-light { + display: none; +} diff --git a/mkdocs.yml b/mkdocs.yml index 01b3fba..3bc4a74 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,9 +11,18 @@ theme: name: material custom_dir: custom_theme/ palette: - scheme: slate - primary: indigo - accent: lime + - scheme: slate + primary: black + accent: purple + toggle: + icon: material/brightness-4 + name: Switch to light mode + - scheme: default + primary: black + accent: purple + toggle: + icon: material/brightness-7 + name: Switch to dark mode favicon: img/oscal-compass-icon-1200x1200.png logo: img/oscal-compass-icon-1200x1200.png font: @@ -21,7 +30,10 @@ theme: code: Azeret Mono features: - navigation.footer - extra: - social: - - icon: fontawesome/brands/github - link: https://github.com/oscal-compass + - navigation.tabs +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/oscal-compass +extra_css: + - css/extra.css diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a06b3eb --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +mkdocs-material>=9.6.0 +mkdocs-awesome-pages-plugin>=2.10.0