Skip to content

fix: Fix monorepo compability #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ dev-dependencies = [
"mkdocs-gen-files>=0.5.0",
"mkdocs-git-authors-plugin>=0.9.2",
"mkdocs-material>=9.6.7",
"mkdocs-techdocs-core",
"mkdocs-monorepo-plugin>=1.1.0",
"mkdocs-static-i18n>=1.3.0",
"pytest>=8.3.5",
Expand Down
5 changes: 3 additions & 2 deletions src/mkdocs_git_revision_date_localized_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ def on_files(self, files: Files, config: MkDocsConfig):
return

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

Expand Down
Empty file.
9 changes: 9 additions & 0 deletions tests/fixtures/techdocs-core/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Welcome to our Developer Platform

This contains the documentation for our Developer Platform.

## API


- Markdown source: `sample-docs/docs/index.md`
- Permalink: <https://backstage.github.io/mkdocs-monorepo-plugin/monorepo-example/>
13 changes: 13 additions & 0 deletions tests/fixtures/techdocs-core/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
site_name: Cats API

nav:
- Intro: 'index.md'
- Authentication: 'authentication.md'

theme:
name: material

plugins:
- techdocs-core
- git-revision-date-localized:
enable_creation_date: true
1 change: 1 addition & 0 deletions tests/test_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ def validate_mkdocs_file(temp_path: str, mkdocs_yml_file: str):
"basic_project/mkdocs_timeago_locale.yml",
"basic_project/mkdocs_timeago.yml",
"basic_project/mkdocs_with_override.yml",
"techdocs-core/mkdocs.yml",
# 'i18n/mkdocs.yml'
]

Expand Down
66 changes: 40 additions & 26 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading