mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 22:50:35 +03:00
Fix aliases with relativeURLs
This commit is contained in:
parent
01e249e97c
commit
145b3fcce3
7 changed files with 54 additions and 43 deletions
|
@ -277,9 +277,14 @@ func (s *sitesBuilder) WithSimpleConfigFile() *sitesBuilder {
|
|||
|
||||
func (s *sitesBuilder) WithSimpleConfigFileAndBaseURL(baseURL string) *sitesBuilder {
|
||||
s.T.Helper()
|
||||
config := fmt.Sprintf("baseURL = %q", baseURL)
|
||||
return s.WithSimpleConfigFileAndSettings(map[string]interface{}{"baseURL": baseURL})
|
||||
}
|
||||
|
||||
config = config + commonConfigSections
|
||||
func (s *sitesBuilder) WithSimpleConfigFileAndSettings(settings interface{}) *sitesBuilder {
|
||||
s.T.Helper()
|
||||
var buf bytes.Buffer
|
||||
parser.InterfaceToConfig(settings, metadecoders.TOML, &buf)
|
||||
config := buf.String() + commonConfigSections
|
||||
return s.WithConfigFile("toml", config)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue