Skip to content

Add a pkgdown build helper that drops internal-markdown pages#103

Merged
kassambara merged 1 commit into
masterfrom
chore/pkgdown-drop-internal-md
Jul 9, 2026
Merged

Add a pkgdown build helper that drops internal-markdown pages#103
kassambara merged 1 commit into
masterfrom
chore/pkgdown-drop-internal-md

Conversation

@kassambara

Copy link
Copy Markdown
Owner

Problem

pkgdown renders every root-level *.md into a site page (all except README/LICENSE/NEWS and a couple of hardcoded templates) and it does not consult .Rbuildignore. So a bare pkgdown::build_site() publishes the internal CLAUDE.md as docs/CLAUDE.html. pkgdown provides no option to exclude a root .md.

Fix

tools/build-site.R is the canonical pkgdown build: it runs build_site() and then removes any page generated from an .Rbuildignored root .md (currently CLAUDE.md). Fully general — it derives the internal set from .Rbuildignore, so any future internal .md (e.g. TODO.md) is handled automatically. tools/ is added to .Rbuildignore so the helper never ships in the package tarball.

Verified: after Rscript tools/build-site.R, docs/CLAUDE.html is gone and the real pages (home, reference, both articles, news) remain; R CMD build excludes tools/.

pkgdown renders every root-level *.md into a page and does not consult
.Rbuildignore, so a bare build_site() publishes an internal file such as
CLAUDE.md as docs/CLAUDE.html. pkgdown has no option to exclude a root .md,
so tools/build-site.R builds the site and then removes any page generated
from an .Rbuildignore'd root .md. Ignore tools/ from the build.
@kassambara kassambara merged commit 4b71462 into master Jul 9, 2026
5 checks passed
@kassambara kassambara deleted the chore/pkgdown-drop-internal-md branch July 9, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant