Skip to content

Stop generating a separate page file for main_page#1624

Merged
tompng merged 2 commits intomasterfrom
skip-main-page-generation
Feb 24, 2026
Merged

Stop generating a separate page file for main_page#1624
tompng merged 2 commits intomasterfrom
skip-main-page-generation

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Feb 23, 2026

When a page is used as main_page (e.g. README.md), its content is already displayed on index.html. Generating a separate page file (e.g. README_md.html) is redundant.

Skip the main_page in:

  • darkfish generator (page file generation)
  • json search index (avoids linking to a nonexistent page)
  • aliki sidebar pages template

When a page is used as main_page (e.g. README.md), its content is
already displayed on index.html. Generating a separate page file
(e.g. README_md.html) is redundant.

Skip the main_page in:
- darkfish generator (page file generation)
- json search index (avoids linking to a nonexistent page)
- aliki sidebar pages template
@st0012 st0012 added the bug label Feb 23, 2026
@matzbot
Copy link
Collaborator

matzbot commented Feb 23, 2026

🚀 Preview deployment available at: https://6f944c09.rdoc-6cd.pages.dev (commit: e42e833)

@tompng
Copy link
Member

tompng commented Feb 23, 2026

Looks like separate page file is still generated. README_md.html is generated and linked from main page by crossref resolve.

<p>Please follow the theme’s <a href="README_md.html">README</a> for usage instructions.</p>

However, I don't think this is a problem. If we don't generate the file, we need to also fix crossref part to avoid linking to a file which is not generated.

@tompng
Copy link
Member

tompng commented Feb 23, 2026

Sorry, https://50c952f8.rdoc-6cd.pages.dev/README_md.html looks like a cached file, it's not generated.
Text "README" in a document is linked to a file which is not generated.

When a page is set as main_page, its content is displayed on
index.html and no separate page file is generated. Update
TopLevel#path to return index.html for the main_page so all
consumers (cross-references, sidebar links, table of contents,
search records) automatically generate correct links.

Also tighten the generate_file_files skip to only apply to text
pages, preventing accidental skipping if a source file is set as
main_page.
@st0012
Copy link
Member Author

st0012 commented Feb 23, 2026

@tompng Thanks, fixed

@tompng tompng merged commit 92b07d6 into master Feb 24, 2026
68 checks passed
@tompng tompng deleted the skip-main-page-generation branch February 24, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants