Skip to content

Commit da51521

Browse files
andrzejnovakclaude
andcommitted
feat: Add cms-docs-common submodule to demonstrate config_file
Enhanced the example site to demonstrate the config_file feature: - Added cms-docs-common as git submodule - Updated mkdocs.yml to load CMS POG dropdown from shared config - Now shows 3 dropdowns: 1 from config_file + 2 from mkdocs.yml - Updated documentation to explain the mixed configuration approach The example now demonstrates: 1. Loading shared config via git submodule (CMS POG Docs) 2. Adding site-specific dropdowns (Examples, Resources) 3. How both sources work together seamlessly This provides a complete reference implementation for users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d1274c3 commit da51521

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "example/cms-docs-common"]
2+
path = example/cms-docs-common
3+
url = https://github.com/cms-cat/cms-docs-common.git

example/cms-docs-common

Submodule cms-docs-common added at aa3c4a9

example/docs/getting-started.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,22 @@ plugins:
7171
- header-dropdown:
7272
config_file: "shared-config/dropdowns.yml"
7373
```
74+
75+
**Live Example**: The "CMS POG Docs" dropdown in this site's header is loaded from the [cms-docs-common](https://github.com/cms-cat/cms-docs-common) repository via git submodule!
76+
77+
## Mixing Configuration Sources
78+
79+
You can combine shared config with site-specific dropdowns:
80+
81+
```yaml
82+
plugins:
83+
- header-dropdown:
84+
config_file: "cms-docs-common/header-dropdown.yml" # Shared
85+
dropdowns: # Site-specific
86+
- title: "Local Links"
87+
links:
88+
- text: "About"
89+
url: "/about/"
90+
```
91+
92+
Both will appear in the header - check this example site to see it in action!

example/docs/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ This plugin adds configurable dropdown menus to your MkDocs Material theme heade
1616

1717
## Check the Header!
1818

19-
Look at the header above - you'll see example dropdown menus demonstrating the plugin's capabilities.
19+
Look at the header above - you'll see **three dropdown menus** demonstrating the plugin's capabilities:
20+
21+
1. **CMS POG Docs** - Loaded from a shared configuration file via git submodule (`cms-docs-common`)
22+
2. **Examples** - Defined directly in `mkdocs.yml`
23+
3. **Resources** - Also defined directly in `mkdocs.yml`
24+
25+
This demonstrates both configuration methods working together!
2026

2127
## Installation
2228

example/mkdocs.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ theme:
3131
plugins:
3232
- search
3333
- header-dropdown:
34+
config_file: "cms-docs-common/header-dropdown.yml"
3435
dropdowns:
3536
- title: "Examples"
3637
links:
@@ -49,14 +50,6 @@ plugins:
4950
- text: "Material Theme Docs"
5051
url: "https://squidfunk.github.io/mkdocs-material/"
5152
target: "_blank"
52-
- title: "Related Projects"
53-
links:
54-
- text: "MkDocs"
55-
url: "https://www.mkdocs.org/"
56-
target: "_blank"
57-
- text: "Material for MkDocs"
58-
url: "https://squidfunk.github.io/mkdocs-material/"
59-
target: "_blank"
6053

6154
markdown_extensions:
6255
- admonition

0 commit comments

Comments
 (0)