mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
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
This commit is contained in:
parent
478a9107a6
commit
d5542ed286
4 changed files with 101 additions and 5 deletions
|
@ -69,6 +69,11 @@ type Target struct {
|
|||
// Parsed versions of Include/Exclude.
|
||||
IncludeGlob glob.Glob `json:"-"`
|
||||
ExcludeGlob glob.Glob `json:"-"`
|
||||
|
||||
// If true, any local path matching <dir>/index.html will be mapped to the
|
||||
// remote path <dir>/. This does not affect the top-level index.html file,
|
||||
// since that would result in an empty path.
|
||||
StripIndexHTML bool
|
||||
}
|
||||
|
||||
func (tgt *Target) ParseIncludeExclude() error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue