mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
all: Unify case of config variable names
All config variables starts with low-case and uses camelCase. If there is abbreviation at the beginning of the name, the whole abbreviation will be written in low-case. If there is abbreviation at the end of the name, the whole abbreviation will be written in upper-case. For example, rssURI.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
d9f54a13c1
commit
f21e2f25c9
@@ -157,7 +157,7 @@ func (p *PathSpec) AbsURL(in string, addLanguage bool) string {
|
||||
return in
|
||||
}
|
||||
|
||||
baseURL := viper.GetString("BaseURL")
|
||||
baseURL := viper.GetString("baseURL")
|
||||
if strings.HasPrefix(in, "/") {
|
||||
p, err := url.Parse(baseURL)
|
||||
if err != nil {
|
||||
@@ -219,7 +219,7 @@ func IsAbsURL(path string) bool {
|
||||
// RelURL creates a URL relative to the BaseURL root.
|
||||
// Note: The result URL will not include the context root if canonifyURLs is enabled.
|
||||
func (p *PathSpec) RelURL(in string, addLanguage bool) string {
|
||||
baseURL := viper.GetString("BaseURL")
|
||||
baseURL := viper.GetString("baseURL")
|
||||
canonifyURLs := p.canonifyURLs
|
||||
if (!strings.HasPrefix(in, baseURL) && strings.HasPrefix(in, "http")) || strings.HasPrefix(in, "//") {
|
||||
return in
|
||||
|
Reference in New Issue
Block a user