Skip to content

Commit fbd3e56

Browse files
authored
Merge pull request #174 from timo-reymann/fix/monorepo-compability
fix: Fix monorepo compability
2 parents 1befc7b + d114cce commit fbd3e56

File tree

7 files changed

+67
-28
lines changed

7 files changed

+67
-28
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ dev-dependencies = [
119119
"mkdocs-gen-files>=0.5.0",
120120
"mkdocs-git-authors-plugin>=0.9.2",
121121
"mkdocs-material>=9.6.7",
122+
"mkdocs-techdocs-core",
122123
"mkdocs-monorepo-plugin>=1.1.0",
123124
"mkdocs-static-i18n>=1.3.0",
124125
"pytest>=8.3.5",

src/mkdocs_git_revision_date_localized_plugin/plugin.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ def on_files(self, files: Files, config: MkDocsConfig):
184184
return
185185

186186
# Support monorepo/techdocs, which copies the docs_dir to a temporary directory
187-
if "monorepo" in config.get("plugins", {}):
188-
original_source = config.get("plugins").get("monorepo").merger.files_source_dir
187+
mono_repo_plugin = config.get("plugins", {}).get("monorepo", None)
188+
if mono_repo_plugin is not None and hasattr(mono_repo_plugin, "merger") and mono_repo_plugin.merger is not None:
189+
original_source = mono_repo_plugin.merger.files_source_dir
189190
else:
190191
original_source = None
191192

tests/fixtures/techdocs-core/docs/authentication.md

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Welcome to our Developer Platform
2+
3+
This contains the documentation for our Developer Platform.
4+
5+
## API
6+
7+
8+
- Markdown source: `sample-docs/docs/index.md`
9+
- Permalink: <https://backstage.github.io/mkdocs-monorepo-plugin/monorepo-example/>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
site_name: Cats API
2+
3+
nav:
4+
- Intro: 'index.md'
5+
- Authentication: 'authentication.md'
6+
7+
theme:
8+
name: material
9+
10+
plugins:
11+
- techdocs-core
12+
- git-revision-date-localized:
13+
enable_creation_date: true

tests/test_builds.py

+1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def validate_mkdocs_file(temp_path: str, mkdocs_yml_file: str):
351351
"basic_project/mkdocs_timeago_locale.yml",
352352
"basic_project/mkdocs_timeago.yml",
353353
"basic_project/mkdocs_with_override.yml",
354+
"techdocs-core/mkdocs.yml",
354355
# 'i18n/mkdocs.yml'
355356
]
356357

uv.lock

+40-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)