aboutsummaryrefslogtreecommitdiffhomepage
path: root/common
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-03-12 08:18:23 -0700
committerBjørn Erik Pedersen <[email protected]>2024-03-13 17:34:42 +0200
commitdc6a292133bf3249f1741a7624075b0782b16f84 (patch)
treeee11263c7a02b7f68e33185851511c08bb14c843 /common
parent4f92f949eaf8c9827a758b3caadc672e0335480b (diff)
downloadhugo-dc6a292133bf3249f1741a7624075b0782b16f84.tar.gz
hugo-dc6a292133bf3249f1741a7624075b0782b16f84.zip
common/hugo: Rename IsMultiHost and IsMultiLingual
hugo.IsMultiHost => hugo.IsMultihost hugo.IsMultiLingual => hugo.IsMultilingual Closes #12232
Diffstat (limited to 'common')
-rw-r--r--common/hugo/hugo.go16
-rw-r--r--common/hugo/hugo_integration_test.go6
-rw-r--r--common/hugo/hugo_test.go2
3 files changed, 15 insertions, 9 deletions
diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go
index a3d1a7bfc..0589ac9a3 100644
--- a/common/hugo/hugo.go
+++ b/common/hugo/hugo.go
@@ -111,14 +111,20 @@ func (i HugoInfo) Deps() []*Dependency {
return i.deps
}
-// IsMultiHost reports whether each configured language has a unique baseURL.
+// Deprecated: Use hugo.IsMultihost instead.
func (i HugoInfo) IsMultiHost() bool {
+ Deprecate("hugo.IsMultiHost", "Use hugo.IsMultihost instead.", "v0.124.0")
return i.conf.IsMultihost()
}
-// IsMultiLingual reports whether there are two or more configured languages.
-func (i HugoInfo) IsMultiLingual() bool {
- return i.conf.IsMultiLingual()
+// IsMultihost reports whether each configured language has a unique baseURL.
+func (i HugoInfo) IsMultihost() bool {
+ return i.conf.IsMultihost()
+}
+
+// IsMultilingual reports whether there are two or more configured languages.
+func (i HugoInfo) IsMultilingual() bool {
+ return i.conf.IsMultilingual()
}
// ConfigProvider represents the config options that are relevant for HugoInfo.
@@ -127,7 +133,7 @@ type ConfigProvider interface {
Running() bool
WorkingDir() string
IsMultihost() bool
- IsMultiLingual() bool
+ IsMultilingual() bool
}
// NewInfo creates a new Hugo Info object.
diff --git a/common/hugo/hugo_integration_test.go b/common/hugo/hugo_integration_test.go
index 9fcfb95cf..77dbb5c91 100644
--- a/common/hugo/hugo_integration_test.go
+++ b/common/hugo/hugo_integration_test.go
@@ -20,7 +20,7 @@ import (
"github.com/gohugoio/hugo/hugolib"
)
-func TestIsMultiLingualAndIsMultiHost(t *testing.T) {
+func TestIsMultilingualAndIsMultihost(t *testing.T) {
t.Parallel()
files := `
@@ -36,8 +36,8 @@ baseURL = 'https://en.example.org/'
title: home
---
-- layouts/index.html --
-multilingual={{ hugo.IsMultiLingual }}
-multihost={{ hugo.IsMultiHost }}
+multilingual={{ hugo.IsMultilingual }}
+multihost={{ hugo.IsMultihost }}
`
b := hugolib.Test(t, files)
diff --git a/common/hugo/hugo_test.go b/common/hugo/hugo_test.go
index e1d907158..6e8b2620e 100644
--- a/common/hugo/hugo_test.go
+++ b/common/hugo/hugo_test.go
@@ -88,6 +88,6 @@ func (c testConfig) IsMultihost() bool {
return c.multihost
}
-func (c testConfig) IsMultiLingual() bool {
+func (c testConfig) IsMultilingual() bool {
return c.multilingual
}