Repository navigation
feat: copy static/ to the output root - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds one convention: if a site has a
static/folder, its contents are copied to the root of the output as is. Sites without the folder are unaffected, and there is no newink.yamloption.my-site/ ├── pages/ ├── assets/ → public/assets/... +└── static/ → public/... (robots.txt, CNAME, demo.html)Build copyTheme copyAssets + copyStatic # before pages, so a built page wins a name clash buildPage (each)Until now nothing but built pages could land at the site root, so
robots.txt, aCNAME, a verification file or a standalone HTML page needed a copy step outside inkssg. That also meantinkssg servecould not serve them. The watcher already covers the whole project, sostatic/changes trigger a rebuild with no extra code.Evidence
static/is ignored byinkssg build.After: new test
TestBuildCopiesStaticToOutputRoot:go vet ./...passes and theminimal,multi-pageandbioexamples still build.go test ./.... This is the first test in the repo.inkssg serveon a scratch site:/added.txtreturned 404, then 200 after the file was dropped intostatic/and the log printed↻ rebuilt. Dotfiles (.well-known/security.txt) are copied, andstatic/assets/x.txtoverridesassets/x.txt.docs/inkssg.md(uses, assets vs static table, clash order, serve), a short table in the README, and arobots.txtin the multi-page example.Merge Danger
Door: one-way
Once released, sites will depend on
static/, so removing it later is a breaking change.It also changes a written decision: one
assets/directory, one copy rule. This makes it two rules.PRINCIPLES.mdis updated to say paths are literal for both folders.Blast Radius: small
static/folder will start publishing it at the root.copyDirignores read and write errors, as it already does forassets/.