Skip to content

chore: Stop tracking the _site build output - #21

Merged
DannyvdSluijs merged 1 commit into
fix/footer-sitemap-rss-linksfrom
chore/gitignore-site-output
Aug 19, 2026
Merged

chore: Stop tracking the _site build output#21
DannyvdSluijs merged 1 commit into
fix/footer-sitemap-rss-linksfrom
chore/gitignore-site-output

Conversation

@DannyvdSluijs

Copy link
Copy Markdown
Contributor

Stacked on #20 — please merge that first. GitHub will retarget this to main automatically once it lands.

Why

CI builds the site from source on every push to main (hydephp/action runs php hyde build, then uploads _site), so the committed output is never read by the deploy. Tracking it costs us churn and merge conflicts on generated HTML, and lets source and output diverge — #19 merged docs source without rebuilding _site, and the output differs depending on whether SITE_URL is set at build time.

The stale files actually reach production

Hyde's CleanSiteDirectory pre-build task calls:

Filesystem::unlink(Filesystem::findFiles(Hyde::sitePath(), ['html', 'json'])->all());

findFiles() defaults to $recursive = false and is never passed true, so "Removing all files from build directory" only clears top-level _site/*.html — never _site/docs/. Committed files in subdirectories survive the clean and get uploaded with the artifact.

That is why these two are live today despite having no source in _docs/:

URLStatusSource?
/docs/docs/community-guide.html200none
/docs/docs/configuration.html200none

Untracking removes them from the next deploy. Worth re-checking both return 404 after this merges.

Change

Uncomments the /_site rule already present in .gitignore and drops the directory from the index. Local build output is left on disk; use php hyde serve to preview.

Tradeoff

Nothing in the repo will show the built site anymore, so a template regression surfaces only on deploy or via a local serve. If that is a concern, the follow-up is a PR build-check job (hydephp/action with deploy-to: artifact) — happy to open that separately.

🤖 Generated with Claude Code

The CI workflow builds the site from source on every push to main
(hydephp/action runs `php hyde build` then uploads _site), so the
committed output is never read by the deploy. Tracking it only costs
us churn and merge conflicts on generated HTML, and lets the two
diverge: #19 merged docs source without rebuilding _site, and the
output differs depending on whether SITE_URL is set at build time.
Worse, the stale files actually reach production. Hyde's
CleanSiteDirectory pre-build task calls Filesystem::findFiles() with
the default $recursive = false, so it only clears top-level
_site/*.html and never _site/docs/. Committed files in subdirectories
survive the clean and get uploaded, which is why
/docs/docs/community-guide.html and /docs/docs/configuration.html are
still live despite having no source in _docs/. Untracking them removes
them from the next deploy.
Uncomment the /_site rule that was already present in .gitignore and
drop the directory from the index. The local build output is left on
disk untouched; use `php hyde serve` to preview builds.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DannyvdSluijs
DannyvdSluijs merged commit cfd27b8 into mainAug 19, 2026
@DannyvdSluijs
DannyvdSluijs deleted the chore/gitignore-site-output branch August 19, 2026 18:49
Sign up for freeto 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

@DannyvdSluijs