From 8feabdd416c76588c40fe3bf15af940582ffd024 Mon Sep 17 00:00:00 2001 From: Hassan Kibirige Date: Fri, 4 Dec 2026 14:26:12 +0300 Subject: [PATCH] feat: control generated project pages Allow authors to turn off individual generated project pages and preserve links between the pages that publish. --- docs/user_guide/05-configuration.qmd | 20 ++- great_docs/_build/content.py | 4 +- great_docs/_content/site_root.py | 39 +++-- great_docs/_website/homepage/margin.py | 31 ++-- great_docs/_website/homepage/page.py | 57 +------ great_docs/_website/project_pages/citation.py | 9 +- .../_website/project_pages/community.py | 140 +++++++++++++----- great_docs/_website/project_pages/licence.py | 9 +- great_docs/assets/great-docs.default.yml | 15 +- great_docs/config.py | 10 ++ tests/test_build_content.py | 76 ++++++++++ tests/test_config_defaults.py | 5 + tests/test_content_site_root.py | 2 +- 13 files changed, 284 insertions(+), 133 deletions(-) diff --git a/docs/user_guide/05-configuration.qmd b/docs/user_guide/05-configuration.qmd index d398beb62..72d19bd47 100644 --- a/docs/user_guide/05-configuration.qmd +++ b/docs/user_guide/05-configuration.qmd @@ -1456,9 +1456,27 @@ The timestamp records the site's last build. ```{.yaml filename="docs/great-docs.yml"} show_dates: true # Enable/disable page metadata (default: false) show_author: true # Show author attribution when enabled (default: true) -show_security: true # Show security policy page from SECURITY.md (default: true) ``` +### Community Pages + +Great Docs generates these pages when the corresponding project files exist. Set a page's +option to `false` to keep an authored page at its existing URL without generating a second +copy. + +| Setting | Project file | Generated URL | +|---------|--------------|---------------| +| `show_contributing` | `CONTRIBUTING.md` | `contributing.html` | +| `show_code_of_conduct` | `CODE_OF_CONDUCT.md` | `code-of-conduct.html` | +| `show_roadmap` | `ROADMAP.md` | `roadmap.html` | +| `show_security` | `SECURITY.md` | `security.html` | +| `show_licence` | `LICENSE` | `license.html` | +| `show_citation` | `CITATION.cff` | `citation.html` | + +All six settings default to `true`. For example, if your site already publishes +`conduct.html`, keep its source page in your documentation and set +`show_code_of_conduct: false`. + ### Author Attribution When `show_author` is enabled and a page has author information in its frontmatter, author avatars diff --git a/great_docs/_build/content.py b/great_docs/_build/content.py index 4d695bb8c..cb6126ac3 100644 --- a/great_docs/_build/content.py +++ b/great_docs/_build/content.py @@ -142,7 +142,9 @@ def homepage( _ = licence.write_page(config, layout, metadata["license"], page_authors, report=print) citation_ref = ( source_ref(config, layout.package_root, warn=print_warning) - if run.project.repository is not None and (layout.package_root / "CITATION.cff").is_file() + if config.show_citation + and run.project.repository is not None + and (layout.package_root / citation.SOURCE_FILENAME).is_file() else "main" ) _ = citation.write_page( diff --git a/great_docs/_content/site_root.py b/great_docs/_content/site_root.py index ba9d4072c..351327735 100644 --- a/great_docs/_content/site_root.py +++ b/great_docs/_content/site_root.py @@ -34,6 +34,7 @@ "NOT_FOUND_PAGE", "Files", "GeneratedName", + "community_page_enabled", "find_generated", "find_pages", "generated_names", @@ -75,20 +76,21 @@ class GeneratedName: """The source directory whose files may share this section's output""" -_PROJECT_PAGES: dict[str, str | None] = { - "changelog": "changelog.enabled: false", - "citation": None, - "code-of-conduct": None, - "contributing": None, - "license": None, - "package-info": "package_info_page.enabled: false", - "roadmap": None, - "security": "show_security: false", +_COMMUNITY_PAGE_SETTINGS = { + "citation": "show_citation", + "code-of-conduct": "show_code_of_conduct", + "contributing": "show_contributing", + "license": "show_licence", + "roadmap": "show_roadmap", + "security": "show_security", } -""" -The stems of the project pages that a page beside the configuration replaces, each with -the setting that stops Great Docs generating it, or `None` when no setting does -""" + +_PROJECT_PAGES = { + "changelog": "changelog.enabled", + "package-info": "package_info_page.enabled", + **_COMMUNITY_PAGE_SETTINGS, +} +"""The stems of replaceable project pages and the settings for their generators""" _FILES = { "_quarto.yml": "writes the Quarto project configuration `_quarto.yml`", @@ -180,6 +182,7 @@ def generated_names( replaceable=True, ) for stem in _PROJECT_PAGES + if stem not in _COMMUNITY_PAGE_SETTINGS or community_page_enabled(config, stem) ) names.extend(_llms_txt_names(config)) if config.sitemap_enabled: @@ -640,6 +643,11 @@ def validate(config: Config, layout: Layout) -> None: ) +def community_page_enabled(config: Config, stem: str) -> bool: + """Check whether the project enables the named community page generator""" + return bool(config[_COMMUNITY_PAGE_SETTINGS[stem]]) + + def generator_off_switch(page: Path) -> str | None: """ Find the setting that stops Great Docs generating the project page `page` replaces @@ -653,9 +661,10 @@ def generator_off_switch(page: Path) -> str | None: ------- : The setting as written in the configuration, such as `changelog.enabled: false`, - or `None` when `page` replaces no project page or no setting stops its generation. + or `None` when `page` has no generated counterpart. """ - return _PROJECT_PAGES.get(page.stem) + setting = _PROJECT_PAGES.get(page.stem) + return f"{setting}: false" if setting is not None else None def remove_generated_page(layout: Layout, page: Path) -> Path | None: diff --git a/great_docs/_website/homepage/margin.py b/great_docs/_website/homepage/margin.py index 01f2d9b67..2b6fef343 100644 --- a/great_docs/_website/homepage/margin.py +++ b/great_docs/_website/homepage/margin.py @@ -22,7 +22,7 @@ from ..._project.layout import Layout from ..._project.repository import Repository from ...config import Config - from ..project_pages.community import CommunityPage + from ..project_pages.community import Published __all__ = ["render"] @@ -62,14 +62,13 @@ def render( metadata: Manifest, repository: Repository | None, package_name: str | None, - community_pages: Sequence[CommunityPage], + community_pages: Published, llms_txt: Sequence[str], ) -> str: """ Render the homepage sidebar as Markdown - The sidebar links to the licence, citation and package-info pages when they are in the - build directory, so it is rendered after them. + The sidebar links to the community and package information pages that the site publishes. Parameters ---------- @@ -85,7 +84,7 @@ def render( package_name The package name, for the PyPI link, the curated skill and the citation link. community_pages - The community pages written for the site. + The site's destinations for the community pages. llms_txt The `llms.txt` files the site publishes, which the sidebar links to. @@ -100,7 +99,7 @@ def render( *_links(config, metadata, repository, package_name, lang), *_ai_agents(config, layout.package_root, package_name, lang, llms_txt=llms_txt), *_developers(config, metadata, repository, lang), - *_community(build_dir, metadata, package_name, community_pages, lang), + *_community(metadata, package_name, community_pages, lang), *_meta(config, build_dir, metadata, lang), ] return "\n".join(sections) @@ -419,10 +418,9 @@ def _icon_row(icons: list[str]) -> str: def _community( - build_dir: Path, metadata: Manifest, package_name: str | None, - community_pages: Sequence[CommunityPage], + community_pages: Published, lang: str, ) -> list[str]: """ @@ -430,14 +428,12 @@ def _community( Parameters ---------- - build_dir - The Quarto project directory, which may hold `license.qmd` and `citation.qmd`. metadata The package metadata, with the licence identifier. package_name The package name, for the citation link. community_pages - The community pages written for the site. + The site's destinations for the community pages. lang The site language. @@ -447,25 +443,26 @@ def _community( The heading and one line per link, or no lines if there are no links. """ items = [ - f"[{translate(page.label_key, lang)}]({page.filename})
" for page in community_pages + f"[{translate(page.label_key, lang)}]({page.filename})
" + for page in community_pages.policies ] - if (build_dir / "license.qmd").exists(): + if (licence := community_pages.licence) is not None: full_licence = translate("full_license", lang) licence_id: str = metadata.get("license", "") info = get_license_info(licence_id) if licence_id else None if info is not None: items.append( - f'{full_licence} ' + f'{full_licence} ' f'{info.spdx_id}
' ) else: - items.append(f"[{full_licence}](license.qmd)
") + items.append(f"[{full_licence}]({licence})
") - if (build_dir / "citation.qmd").exists(): + if (citation := community_pages.citation) is not None: citing = translate("citing", lang) - items.append(f"[{citing} {package_name or 'this package'}](citation.qmd)
") + items.append(f"[{citing} {package_name or 'this package'}]({citation})
") if not items: return [] diff --git a/great_docs/_website/homepage/page.py b/great_docs/_website/homepage/page.py index c35713e54..5c58fe324 100644 --- a/great_docs/_website/homepage/page.py +++ b/great_docs/_website/homepage/page.py @@ -245,13 +245,14 @@ def write_readme( # README headings sit below the homepage title. body = readme.bump_heading_levels(body) - sidebar = _sidebar( + community_pages = community.write_pages(config, layout, page_authors) + sidebar = margin.render( config, layout, metadata=metadata, repository=repository, package_name=package_name, - page_authors=page_authors, + community_pages=community_pages, llms_txt=llms_txt, ) @@ -339,13 +340,14 @@ def write_blended( # Preserve the front matter title so Quarto's title block matches other user guide pages. content = set_front_matter_option(content, "toc", False) - sidebar = _sidebar( + community_pages = community.write_pages(config, layout, page_authors) + sidebar = margin.render( config, layout, metadata=metadata, repository=repository, package_name=package_name, - page_authors=page_authors, + community_pages=community_pages, llms_txt=llms_txt, ) hero_html, _ = _hero( @@ -428,50 +430,3 @@ def _hero( pages=pages, ) return html, found.body if html else None - - -def _sidebar( - config: Config, - layout: Layout, - *, - metadata: Manifest, - repository: Repository | None, - package_name: str | None, - page_authors: list[dict[str, Any]], - llms_txt: Sequence[str], -) -> str: - """ - Write the community pages and render the homepage's metadata sidebar - - Parameters - ---------- - config - The Great Docs configuration. - layout - The package root to read community pages and discover curated skills, and - the build directory to write community pages and check for linked pages. - metadata - The package metadata. - repository - The selected repository, used for GitHub author-profile fallbacks. - package_name - The package name, or `None` if it is unknown. - page_authors - The configured authors, with local portrait paths replaced by site URLs. - llms_txt - The `llms.txt` files the site publishes. - - Returns - ------- - : - The sidebar's Markdown, or `""` when it has no sections. - """ - return margin.render( - config, - layout, - metadata=metadata, - repository=repository, - package_name=package_name, - community_pages=community.write_pages(config, layout, page_authors), - llms_txt=llms_txt, - ) diff --git a/great_docs/_website/project_pages/citation.py b/great_docs/_website/project_pages/citation.py index ec2a52085..7521315d8 100644 --- a/great_docs/_website/project_pages/citation.py +++ b/great_docs/_website/project_pages/citation.py @@ -19,9 +19,10 @@ from ..._project.layout import Layout from ...config import Config -__all__ = ["FILENAME", "write_page"] +__all__ = ["FILENAME", "SOURCE_FILENAME", "write_page"] FILENAME = "citation.qmd" +SOURCE_FILENAME = "CITATION.cff" def write_page( @@ -64,10 +65,10 @@ def write_page( Returns ------- : - The path of the written page, or `None` if the project has no `CITATION.cff` file. + The written page, or `None` when disabled or missing `CITATION.cff`. """ - source = layout.package_root / "CITATION.cff" - if not source.exists(): + source = layout.package_root / SOURCE_FILENAME + if not config.show_citation or not source.is_file(): return None with open(source, encoding="utf-8") as f: diff --git a/great_docs/_website/project_pages/community.py b/great_docs/_website/project_pages/community.py index 682eee1e4..21e5e50ef 100644 --- a/great_docs/_website/project_pages/community.py +++ b/great_docs/_website/project_pages/community.py @@ -4,16 +4,23 @@ from __future__ import annotations -from dataclasses import dataclass +from dataclasses import dataclass, replace +from pathlib import Path from typing import TYPE_CHECKING, Any +from urllib.parse import unquote, urlsplit, urlunsplit +from ..._content import site_root +from ..._source_refs import source_reference_spans from .. import page_dates +from . import citation, licence if TYPE_CHECKING: + from collections.abc import Mapping + from ..._project.layout import Layout from ...config import Config -__all__ = ["PAGES", "SECURITY", "CommunityPage", "write_pages"] +__all__ = ["Published", "write_pages"] @dataclass(frozen=True, kw_only=True) @@ -36,16 +43,7 @@ class CommunityPage: """The translation key of the page's link text on the homepage""" -SECURITY = CommunityPage( - source="SECURITY.md", - in_github_dir=True, - filename="security.qmd", - title="Security Policy", - label_key="security_policy", -) -"""The security policy page, written only when `show_security` is enabled""" - -PAGES = ( +_PAGES = ( CommunityPage( source="CONTRIBUTING.md", in_github_dir=True, @@ -67,51 +65,86 @@ class CommunityPage: title="Roadmap", label_key="project_roadmap", ), - SECURITY, + CommunityPage( + source="SECURITY.md", + in_github_dir=True, + filename="security.qmd", + title="Security Policy", + label_key="security_policy", + ), ) """The community pages, in the order the homepage links them""" -def write_pages( - config: Config, layout: Layout, authors: list[dict[str, Any]] -) -> list[CommunityPage]: +@dataclass(frozen=True, kw_only=True) +class Published: + """The site's destinations for links to community pages""" + + policies: tuple[CommunityPage, ...] + """The community Markdown pages, in homepage link order""" + + licence: str | None + """The licence page filename if published""" + + citation: str | None + """The citation page filename if published""" + + +def write_pages(config: Config, layout: Layout, authors: list[dict[str, Any]]) -> Published: """ - Write community pages from the project's Markdown files + Publish community Markdown and find the site's community page links - Each page uses its own title and the source text with an initial `# ` heading removed. - The security policy page is written only when `show_security` is enabled. + Use an authored site-root page when it replaces a generated page. Resolve + repository-relative links to the community pages the site actually publishes. Parameters ---------- config - The Great Docs configuration. + The Great Docs configuration, including the page generators to run. layout - The package root holding the source Markdown files and the build directory - to write the community pages into. + The package root with the community Markdown files and the build directory + where community pages publish. authors The configured authors, with local portrait paths replaced by site URLs. Returns ------- : - The pages written, in the order of `PAGES`. + The community destinations, including any licence and citation pages. """ - package_root = layout.package_root - written: list[CommunityPage] = [] - for page in PAGES: - if page is SECURITY and not config.show_security: + authored = {page.stem: page.name for page in site_root.find_pages(config, layout)} + policy_sources: dict[CommunityPage, Path] = {} + for page in _PAGES: + source = layout.package_root / page.source + if not source.is_file() and page.in_github_dir: + source = layout.package_root / ".github" / page.source + if not source.is_file(): continue - source = package_root / page.source - if not source.exists() and page.in_github_dir: - source = package_root / ".github" / page.source - if not source.exists(): + stem = Path(page.filename).stem + if (replacement := authored.get(stem)) is not None: + policy_sources[replace(page, filename=replacement)] = source + elif site_root.community_page_enabled(config, stem): + policy_sources[page] = source + + links = {source.resolve(): page.filename for page, source in policy_sources.items()} + licence_page = _published_filename(config, layout, licence.FILENAME, authored) + citation_page = _published_filename(config, layout, citation.FILENAME, authored) + for source_name, output in ( + (licence.SOURCE_FILENAME, licence_page), + (citation.SOURCE_FILENAME, citation_page), + ): + source = layout.package_root / source_name + if output is not None and source.is_file(): + links[source.resolve()] = output + + for page, source in policy_sources.items(): + if Path(page.filename).stem in authored: continue - text = source.read_text(encoding="utf-8") - lines = text.split("\n") - if lines and lines[0].startswith("# "): - text = "\n".join(lines[1:]).lstrip() - + heading, _, body = text.partition("\n") + if heading.startswith("# "): + text = body.lstrip() + text = _rebase_links(text, source.parent, links) content = f"""--- title: "{page.title}" --- @@ -121,5 +154,36 @@ def write_pages( _ = (layout.build_dir / page.filename).write_text( page_dates.add_to_page(content, source, config, authors), encoding="utf-8" ) - written.append(page) - return written + return Published(policies=tuple(policy_sources), licence=licence_page, citation=citation_page) + + +def _published_filename( + config: Config, layout: Layout, generated: str, authored: Mapping[str, str] +) -> str | None: + """Find an authored or generated project page for a link""" + stem = Path(generated).stem + if (replacement := authored.get(stem)) is not None: + return replacement + if site_root.community_page_enabled(config, stem) and (layout.build_dir / generated).is_file(): + return generated + return None + + +def _rebase_links(text: str, directory: Path, published: Mapping[Path, str]) -> str: + """Point relative links to community files at their published pages""" + for start, end in reversed(source_reference_spans(text)): + try: + url = urlsplit(text[start:end]) + path = unquote(url.path) + if url.scheme or url.netloc or not path or path.startswith("/"): + continue + destination = published.get((directory / path).resolve()) + except (OSError, RuntimeError, ValueError): + continue + if destination is not None: + # Quarto leaves URLs with queries as written, including their extensions. + if url.query: + destination = Path(destination).with_suffix(".html").name + updated = urlunsplit(("", "", destination, url.query, url.fragment)) + text = text[:start] + updated + text[end:] + return text diff --git a/great_docs/_website/project_pages/licence.py b/great_docs/_website/project_pages/licence.py index 2b5b78758..4e0d83897 100644 --- a/great_docs/_website/project_pages/licence.py +++ b/great_docs/_website/project_pages/licence.py @@ -17,9 +17,10 @@ from ..._project.layout import Layout from ...config import Config -__all__ = ["FILENAME", "write_page"] +__all__ = ["FILENAME", "SOURCE_FILENAME", "write_page"] FILENAME = "license.qmd" +SOURCE_FILENAME = "LICENSE" def write_page( @@ -53,10 +54,10 @@ def write_page( Returns ------- : - The path of the written page, or `None` if the project has no `LICENSE` file. + The written page, or `None` when disabled or missing `LICENSE`. """ - source = layout.package_root / "LICENSE" - if not source.exists(): + source = layout.package_root / SOURCE_FILENAME + if not config.show_licence or not source.is_file(): return None licence_text = source.read_text(encoding="utf-8") diff --git a/great_docs/assets/great-docs.default.yml b/great_docs/assets/great-docs.default.yml index 9b2491bc0..a1ec0fe7d 100644 --- a/great_docs/assets/great-docs.default.yml +++ b/great_docs/assets/great-docs.default.yml @@ -310,8 +310,21 @@ show_dates: false # Show author attribution with dates show_author: true -# Show security policy page (from SECURITY.md) +# Generated Community Pages +# ------------------------- +# Write these pages when their corresponding project files exist. +# Generate a page from CONTRIBUTING.md +show_contributing: true +# Generate a page from CODE_OF_CONDUCT.md +show_code_of_conduct: true +# Generate a page from ROADMAP.md +show_roadmap: true +# Generate a page from SECURITY.md show_security: true +# Generate a page from LICENSE +show_licence: true +# Generate a page from CITATION.cff +show_citation: true # Changelog (repository releases) # --------------------------- diff --git a/great_docs/config.py b/great_docs/config.py index 4c6882c13..4890fd015 100644 --- a/great_docs/config.py +++ b/great_docs/config.py @@ -1680,6 +1680,16 @@ def show_security(self) -> bool: """Whether to show the security policy page when SECURITY.md exists.""" return bool(self["show_security"]) + @property + def show_licence(self) -> bool: + """Whether to generate a page for the project's licence file""" + return bool(self["show_licence"]) + + @property + def show_citation(self) -> bool: + """Whether to generate a page for the project's citation file""" + return bool(self["show_citation"]) + @property def lang(self) -> str: """The site language as a BCP 47 tag, from `quarto.format.html.lang`""" diff --git a/tests/test_build_content.py b/tests/test_build_content.py index d3e431d04..0512e153d 100644 --- a/tests/test_build_content.py +++ b/tests/test_build_content.py @@ -287,6 +287,82 @@ def test_a_user_guide_homepage_writes_the_project_pages_but_not_the_readme(tmp_p assert not (docs.layout.build_dir / "index.qmd").exists() +@pytest.mark.parametrize( + ("setting", "stem"), + [ + ("show_code_of_conduct", "code-of-conduct"), + ("show_contributing", "contributing"), + ("show_roadmap", "roadmap"), + ("show_licence", "license"), + ("show_citation", "citation"), + ], +) +def test_each_project_page_can_be_disabled(tmp_path: Path, setting: str, stem: str) -> None: + docs = _project( + tmp_path, + { + "pyproject.toml": '[project]\nname = "example"\nversion = "1.0"\n', + "docs/great-docs.yml": f"{setting}: false\n", + "docs/conduct.qmd": "# Our Conduct\n", + "CODE_OF_CONDUCT.md": "# Code of Conduct\n", + "CONTRIBUTING.md": "# Contributing\n", + "ROADMAP.md": "# Roadmap\n", + "LICENSE": "MIT License\n", + "CITATION.cff": 'title: "Example"\nauthors: []\n', + }, + ) + config = docs._config + layout = docs.layout + run = make_run(docs) + content.homepage(run, config, layout, page_authors=run.page_authors, remote=StubRemote()) + content.site_root_pages(run, config, layout, page_authors=run.page_authors) + + assert (layout.build_dir / "conduct.qmd").is_file() + home = (layout.build_dir / "index.qmd").read_text() + for page in ("code-of-conduct", "contributing", "roadmap", "license", "citation"): + assert (layout.build_dir / f"{page}.qmd").exists() == (page != stem) + assert (f"{page}.qmd" in home) == (page != stem) + + +def test_community_links_follow_published_pages(tmp_path: Path) -> None: + docs = _project( + tmp_path, + { + "pyproject.toml": '[project]\nname = "example"\nversion = "1.0"\n', + "docs/great-docs.yml": "show_roadmap: false\n", + "docs/code-of-conduct.md": "# Authored conduct\n\n## Be kind\n", + ".github/CONTRIBUTING.md": ( + "# Contributing\n\n[Conduct](../CODE_OF_CONDUCT.md?view=full#be-kind)\n" + "[Licence][licence]\n\n[licence]: ../LICENSE\n\n" + 'Citation\n\n' + "[Roadmap](../ROADMAP.md)\n" + "[Other project](https://example.org/CODE_OF_CONDUCT.md)\n" + "`[Example](../CODE_OF_CONDUCT.md)`\n" + ), + "CODE_OF_CONDUCT.md": "# Project conduct\n", + "ROADMAP.md": "# Roadmap\n", + "LICENSE": "MIT License\n", + "CITATION.cff": 'title: "Example"\nauthors: []\n', + }, + ) + config = docs._config + layout = docs.layout + run = make_run(docs) + content.homepage(run, config, layout, page_authors=run.page_authors, remote=StubRemote()) + content.site_root_pages(run, config, layout, page_authors=run.page_authors) + + contribution = (layout.build_dir / "contributing.qmd").read_text() + assert "[Conduct](code-of-conduct.html?view=full#be-kind)" in contribution + assert "[licence]: license.qmd" in contribution + assert 'Citation' in contribution + assert "[Roadmap](../ROADMAP.md)" in contribution + assert "[Other project](https://example.org/CODE_OF_CONDUCT.md)" in contribution + assert "`[Example](../CODE_OF_CONDUCT.md)`" in contribution + assert not (layout.build_dir / "code-of-conduct.qmd").exists() + assert "Authored conduct" in (layout.build_dir / "code-of-conduct.md").read_text() + assert "(code-of-conduct.md)" in (layout.build_dir / "index.qmd").read_text() + + def test_the_user_guide_step_publishes_pages_with_a_sidebar_and_navbar_link(tmp_path: Path): docs = _project( tmp_path, diff --git a/tests/test_config_defaults.py b/tests/test_config_defaults.py index b12f93b1b..6bfa4ebfb 100644 --- a/tests/test_config_defaults.py +++ b/tests/test_config_defaults.py @@ -67,7 +67,12 @@ }, "show_dates": False, "show_author": True, + "show_contributing": True, + "show_code_of_conduct": True, + "show_roadmap": True, "show_security": True, + "show_licence": True, + "show_citation": True, "changelog": {"enabled": True, "max_releases": 50}, "sections": [], "custom_pages": None, diff --git a/tests/test_content_site_root.py b/tests/test_content_site_root.py index 285d67435..3df6adad6 100644 --- a/tests/test_content_site_root.py +++ b/tests/test_content_site_root.py @@ -306,7 +306,7 @@ def test_a_root_page_replaces_the_generated_project_page(tmp_path: Path, capsys) assert "Ours" in (docs.layout.build_dir / "contributing.md").read_text(encoding="utf-8") out = capsys.readouterr().out assert "in place of the generated contributing.qmd" in out - assert "⚠️" not in out + assert "set `show_contributing: false`" in out def test_replacing_a_switchable_project_page_warns_with_its_switch(tmp_path: Path, capsys):