mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -35,8 +35,8 @@ type PathSpec struct {
|
||||
uglyURLs bool
|
||||
canonifyURLs bool
|
||||
|
||||
language *Language
|
||||
languages Languages
|
||||
Language *Language
|
||||
Languages Languages
|
||||
|
||||
// pagination path handling
|
||||
paginatePath string
|
||||
@@ -70,7 +70,7 @@ type PathSpec struct {
|
||||
}
|
||||
|
||||
func (p PathSpec) String() string {
|
||||
return fmt.Sprintf("PathSpec, language %q, prefix %q, multilingual: %T", p.language.Lang, p.getLanguagePrefix(), p.multilingual)
|
||||
return fmt.Sprintf("PathSpec, language %q, prefix %q, multilingual: %T", p.Language.Lang, p.getLanguagePrefix(), p.multilingual)
|
||||
}
|
||||
|
||||
// NewPathSpec creats a new PathSpec from the given filesystems and Language.
|
||||
@@ -113,8 +113,8 @@ func NewPathSpec(fs *hugofs.Fs, cfg config.Provider) (*PathSpec, error) {
|
||||
uglyURLs: cfg.GetBool("uglyURLs"),
|
||||
canonifyURLs: cfg.GetBool("canonifyURLs"),
|
||||
multilingual: cfg.GetBool("multilingual"),
|
||||
language: language,
|
||||
languages: languages,
|
||||
Language: language,
|
||||
Languages: languages,
|
||||
defaultContentLanguageInSubdir: cfg.GetBool("defaultContentLanguageInSubdir"),
|
||||
defaultContentLanguage: cfg.GetString("defaultContentLanguage"),
|
||||
paginatePath: cfg.GetString("paginatePath"),
|
||||
|
@@ -50,7 +50,7 @@ func TestNewPathSpecFromConfig(t *testing.T) {
|
||||
require.True(t, p.removePathAccents)
|
||||
require.True(t, p.uglyURLs)
|
||||
require.Equal(t, "no", p.defaultContentLanguage)
|
||||
require.Equal(t, "no", p.language.Lang)
|
||||
require.Equal(t, "no", p.Language.Lang)
|
||||
require.Equal(t, "side", p.paginatePath)
|
||||
|
||||
require.Equal(t, "http://base.com", p.BaseURL.String())
|
||||
|
@@ -208,7 +208,7 @@ func (p *PathSpec) getLanguagePrefix() string {
|
||||
defaultLang := p.defaultContentLanguage
|
||||
defaultInSubDir := p.defaultContentLanguageInSubdir
|
||||
|
||||
currentLang := p.language.Lang
|
||||
currentLang := p.Language.Lang
|
||||
if currentLang == "" || (currentLang == defaultLang && !defaultInSubDir) {
|
||||
return ""
|
||||
}
|
||||
@@ -221,7 +221,7 @@ func (p *PathSpec) GetLangSubDir(lang string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
if p.languages.IsMultihost() {
|
||||
if p.Languages.IsMultihost() {
|
||||
return ""
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user