]> git.maquefel.me Git - brevno-suite/hugo/commit
deploy: Add stripIndexHtml target option
authorDietrich Epp <djepp@amazon.com>
Tue, 18 Jun 2024 18:26:08 +0000 (14:26 -0400)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 20 Jun 2024 17:37:22 +0000 (19:37 +0200)
commitd5542ed286746e89fb13a1f821d4955ace371773
treeaa726c1ece6b3b9f3dd189baa04efe0bdc32e8ba
parent478a9107a68aeb5dac9ea0cec0a347fadb708b64
deploy: Add stripIndexHtml target option

This new configuration parameter causes paths matching
"<dir>/index.html" to be stored as "<dir>/" remotely. This simplifies
the cloud configuration needed for some use cases, such as CloudFront
distributions with S3 bucket origins. Before this change, users must
configure their S3 buckets as public websites (which is incompatible
with certain authentication / authorization schemes), or users must add
a CloudFormation function to add index.html to the end of incoming
requests. After this change, users can simply use an ordinary CloudFront
distribution (no additional code) with an ordinary S3 bucket origin (and
not an S3 website).

This adds tests to ensure that functionality like matchers is unaffected
by this change. I have also tested that the functionality works as
expected when deploying to a real S3 / CloudFront website.

Closes #12607
deploy/deploy.go
deploy/deploy_test.go
deploy/deployconfig/deployConfig.go
docs/content/en/hosting-and-deployment/hugo-deploy.md