Skip to content

fix(pkgdown): remove CLAUDE.md before build instead of post-build html-only cleanup - #30

Merged
Data-Wise merged 1 commit into
devfrom
fix/pkgdown-doc-leak
Aug 23, 2026
Merged

Data-Wise merged 1 commit into
devfrom
fix/pkgdown-doc-leak

Conversation

@Data-Wise

Copy link
Copy Markdown
Owner

Summary

  • Existing post-build "Remove internal-only pages" step (`rm docs/CLAUDE.html docs/CLAUDE.md`) only removed the rendered HTML + markdown copy — it missed the companion artifacts pkgdown also generates for every root `.md` (`llms.txt`-era markdown twin, `sitemap.xml` entry, full-text `search.json` entry), which still leaked the content.
  • `pkgdown::package_mds()` hardcodes README/LICENSE/LICENCE/NEWS/cran-comments as the only skipped root `.md` files, so `CLAUDE.md` always renders unless removed before the build runs.
  • Moved removal to a pre-build CI step on the disposable checkout; tracked file untouched.

Part of a cross-repo pkgdown-leak remediation (same pattern already applied to medfit #60, probmed #36, mediationverse #22).

Test plan

  • Local pkgdown::build_site_github_pages() (the exact function CI calls) with CLAUDE.md removed first: confirmed docs/CLAUDE.html and docs/CLAUDE.md both absent.
  • No build errors.
  • CLAUDE.md restored via git checkout after local verification (source file untouched).
  • docs/ is gitignored in this repo — no build-artifact cleanup needed.

…l-only cleanup

The existing post-build "Remove internal-only pages" step (rm docs/CLAUDE.html
docs/CLAUDE.md) only removed the rendered .html and its markdown copy inside
docs/ -- it missed the companion artifacts pkgdown also generates for every
root .md (an llms.txt-era markdown twin, a sitemap.xml entry, a full-text
search.json entry), which still leaked the content.

pkgdown::package_mds() hardcodes README/LICENSE/LICENCE/NEWS/cran-comments as
the only skipped root .md files, so CLAUDE.md always gets rendered unless it's
gone before the build runs. Move the removal to a pre-build step on the
disposable CI checkout; the tracked file is untouched.

Verified locally via pkgdown::build_site_github_pages() (the exact function
CI calls) with CLAUDE.md removed first: confirmed docs/CLAUDE.html and
docs/CLAUDE.md both absent, no build errors.
Data-Wise added a commit that referenced this pull request Aug 23, 2026
Source fix in flight (PR #30) for the CLAUDE.md pattern; additionally
purging 20 other stale internal docs under dev/ (PLAN-*, SPEC-*, ISSUE-*,
optimization/setup notes) from a ~2026-06 build -- these were removed
from repo root long ago but never purged from gh-pages. clean: false on
the deploy action means nothing self-heals without explicit removal.
Part of cross-repo pkgdown-leak remediation.
@Data-Wise
Data-Wise merged commit 7819731 into dev Aug 23, 2026
4 checks passed
@Data-Wise
Data-Wise deleted the fix/pkgdown-doc-leak branch August 23, 2026 04:25
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