mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 05:30:54 +03:00
parent
423594e03a
commit
b80853de90
342 changed files with 2118 additions and 2102 deletions
|
@ -408,7 +408,7 @@ func (c *collector) applyMounts(moduleImport Import, mod *moduleAdapter) error {
|
|||
func (c *collector) applyThemeConfig(tc *moduleAdapter) error {
|
||||
var (
|
||||
configFilename string
|
||||
themeCfg map[string]interface{}
|
||||
themeCfg map[string]any
|
||||
hasConfigFile bool
|
||||
err error
|
||||
)
|
||||
|
@ -487,7 +487,7 @@ func (c *collector) applyThemeConfig(tc *moduleAdapter) error {
|
|||
}
|
||||
|
||||
if config.Params == nil {
|
||||
config.Params = make(map[string]interface{})
|
||||
config.Params = make(map[string]any)
|
||||
}
|
||||
|
||||
for k, v := range themeCfg {
|
||||
|
|
|
@ -270,7 +270,7 @@ type Config struct {
|
|||
Imports []Import
|
||||
|
||||
// Meta info about this module (license information etc.).
|
||||
Params map[string]interface{}
|
||||
Params map[string]any
|
||||
|
||||
// Will be validated against the running Hugo version.
|
||||
HugoVersion HugoVersion
|
||||
|
@ -386,10 +386,10 @@ type Mount struct {
|
|||
Lang string // any language code associated with this mount.
|
||||
|
||||
// Include only files matching the given Glob patterns (string or slice).
|
||||
IncludeFiles interface{}
|
||||
IncludeFiles any
|
||||
|
||||
// Exclude all files matching the given Glob patterns (string or slice).
|
||||
ExcludeFiles interface{}
|
||||
ExcludeFiles any
|
||||
}
|
||||
|
||||
// Used as key to remove duplicates.
|
||||
|
|
|
@ -119,12 +119,12 @@ func Pack(fs afero.Fs, fis []hugofs.FileMetaInfo) error {
|
|||
// Replace the dependencies in the original template with the merged set.
|
||||
b.originalPackageJSON[dependenciesKey] = b.dependencies
|
||||
b.originalPackageJSON[devDependenciesKey] = b.devDependencies
|
||||
var commentsm map[string]interface{}
|
||||
var commentsm map[string]any
|
||||
comments, found := b.originalPackageJSON["comments"]
|
||||
if found {
|
||||
commentsm = maps.ToStringMap(comments)
|
||||
} else {
|
||||
commentsm = make(map[string]interface{})
|
||||
commentsm = make(map[string]any)
|
||||
}
|
||||
commentsm[dependenciesKey] = b.dependenciesComments
|
||||
commentsm[devDependenciesKey] = b.devDependenciesComments
|
||||
|
@ -148,10 +148,10 @@ func Pack(fs afero.Fs, fis []hugofs.FileMetaInfo) error {
|
|||
|
||||
func newPackageBuilder(source string, first io.Reader) *packageBuilder {
|
||||
b := &packageBuilder{
|
||||
devDependencies: make(map[string]interface{}),
|
||||
devDependenciesComments: make(map[string]interface{}),
|
||||
dependencies: make(map[string]interface{}),
|
||||
dependenciesComments: make(map[string]interface{}),
|
||||
devDependencies: make(map[string]any),
|
||||
devDependenciesComments: make(map[string]any),
|
||||
dependencies: make(map[string]any),
|
||||
dependenciesComments: make(map[string]any),
|
||||
}
|
||||
|
||||
m := b.unmarshal(first)
|
||||
|
@ -169,12 +169,12 @@ type packageBuilder struct {
|
|||
err error
|
||||
|
||||
// The original package.hugo.json.
|
||||
originalPackageJSON map[string]interface{}
|
||||
originalPackageJSON map[string]any
|
||||
|
||||
devDependencies map[string]interface{}
|
||||
devDependenciesComments map[string]interface{}
|
||||
dependencies map[string]interface{}
|
||||
dependenciesComments map[string]interface{}
|
||||
devDependencies map[string]any
|
||||
devDependenciesComments map[string]any
|
||||
dependencies map[string]any
|
||||
dependenciesComments map[string]any
|
||||
}
|
||||
|
||||
func (b *packageBuilder) Add(source string, r io.Reader) *packageBuilder {
|
||||
|
@ -192,7 +192,7 @@ func (b *packageBuilder) Add(source string, r io.Reader) *packageBuilder {
|
|||
return b
|
||||
}
|
||||
|
||||
func (b *packageBuilder) addm(source string, m map[string]interface{}) {
|
||||
func (b *packageBuilder) addm(source string, m map[string]any) {
|
||||
if source == "" {
|
||||
source = "project"
|
||||
}
|
||||
|
@ -225,8 +225,8 @@ func (b *packageBuilder) addm(source string, m map[string]interface{}) {
|
|||
}
|
||||
}
|
||||
|
||||
func (b *packageBuilder) unmarshal(r io.Reader) map[string]interface{} {
|
||||
m := make(map[string]interface{})
|
||||
func (b *packageBuilder) unmarshal(r io.Reader) map[string]any {
|
||||
m := make(map[string]any)
|
||||
err := json.Unmarshal(helpers.ReaderToBytes(r), &m)
|
||||
if err != nil {
|
||||
b.err = err
|
||||
|
|
|
@ -73,7 +73,7 @@ func TestPackageBuilder(t *testing.T) {
|
|||
|
||||
c.Assert(b.Err(), qt.IsNil)
|
||||
|
||||
c.Assert(b.dependencies, qt.DeepEquals, map[string]interface{}{
|
||||
c.Assert(b.dependencies, qt.DeepEquals, map[string]any{
|
||||
"@babel/cli": "7.8.4",
|
||||
"add1": "1.1.1",
|
||||
"add3": "3.1.1",
|
||||
|
@ -83,7 +83,7 @@ func TestPackageBuilder(t *testing.T) {
|
|||
"tailwindcss": "1.2.0",
|
||||
})
|
||||
|
||||
c.Assert(b.devDependencies, qt.DeepEquals, map[string]interface{}{
|
||||
c.Assert(b.devDependencies, qt.DeepEquals, map[string]any{
|
||||
"tailwindcss": "1.2.0",
|
||||
"@babel/cli": "7.8.4",
|
||||
"@babel/core": "7.9.0",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue