diff --git a/commands/commandeer.go b/commands/commandeer.go index 97cee7acb..f233ce2c3 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -520,8 +520,8 @@ func (r *rootCommand) initRootCommand(subCommandName string, cd *simplecobra.Com commandName = subCommandName } cmd.Use = fmt.Sprintf("%s [flags]", commandName) - cmd.Short = "Build your site" - cmd.Long = `COMMAND_NAME is the main command, used to build your Hugo site. + cmd.Short = "Build your project" + cmd.Long = `COMMAND_NAME is the main command, used to build your Hugo project. Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. @@ -622,13 +622,14 @@ func (r *rootCommand) timeTrack(start time.Time, name string) { } type simpleCommand struct { - use string - name string - short string - long string - run func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *rootCommand, args []string) error - withc func(cmd *cobra.Command, r *rootCommand) - initc func(cd *simplecobra.Commandeer) error + use string + name string + short string + long string + aliases []string + run func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *rootCommand, args []string) error + withc func(cmd *cobra.Command, r *rootCommand) + initc func(cd *simplecobra.Commandeer) error commands []simplecobra.Commander @@ -655,6 +656,7 @@ func (c *simpleCommand) Init(cd *simplecobra.Commandeer) error { cmd := cd.CobraCommand cmd.Short = c.short cmd.Long = c.long + cmd.Aliases = c.aliases if c.use != "" { cmd.Use = c.use } @@ -672,7 +674,7 @@ func (c *simpleCommand) PreRun(cd, runner *simplecobra.Commandeer) error { } func mapLegacyArgs(args []string) []string { - if len(args) > 1 && args[0] == "new" && !hstrings.EqualAny(args[1], "site", "theme", "content") { + if len(args) > 1 && args[0] == "new" && !hstrings.EqualAny(args[1], "project", "site", "theme", "content") { // Insert "content" as the second argument args = append(args[:1], append([]string{"content"}, args[1:]...)...) } diff --git a/commands/config.go b/commands/config.go index ce00c2239..59433b359 100644 --- a/commands/config.go +++ b/commands/config.go @@ -112,8 +112,8 @@ func (c *configCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg func (c *configCommand) Init(cd *simplecobra.Commandeer) error { c.r = cd.Root.Command.(*rootCommand) cmd := cd.CobraCommand - cmd.Short = "Display site configuration" - cmd.Long = `Display site configuration, both default and custom settings.` + cmd.Short = "Display project configuration" + cmd.Long = `Display project configuration, both default and custom settings.` cmd.Flags().StringVar(&c.format, "format", "toml", "preferred file format (toml, yaml or json)") _ = cmd.RegisterFlagCompletionFunc("format", cobra.FixedCompletions([]string{"toml", "yaml", "json"}, cobra.ShellCompDirectiveNoFileComp)) cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for. Defaults to the first language defined.") diff --git a/commands/deploy.go b/commands/deploy.go index 3e9d3df20..2f32bd8f6 100644 --- a/commands/deploy.go +++ b/commands/deploy.go @@ -27,8 +27,8 @@ import ( func newDeployCommand() simplecobra.Commander { return &simpleCommand{ name: "deploy", - short: "Deploy your site to a cloud provider", - long: `Deploy your site to a cloud provider + short: "Deploy your project to a cloud provider", + long: `Deploy your project to a cloud provider See https://gohugo.io/hosting-and-deployment/hugo-deploy/ for detailed documentation. diff --git a/commands/helpers.go b/commands/helpers.go index 5aee7078f..fbe1d362a 100644 --- a/commands/helpers.go +++ b/commands/helpers.go @@ -81,7 +81,7 @@ func flagsToCfgWithAdditionalConfigBase(cd *simplecobra.Commandeer, cfg config.P "editor": "newContentEditor", } - // Flags that we for some reason don't want to expose in the site config. + // Flags that we for some reason don't want to expose in the project config. internalKeySet := map[string]bool{ "quiet": true, "verbose": true, diff --git a/commands/hugobuilder.go b/commands/hugobuilder.go index 779c84e03..559a79362 100644 --- a/commands/hugobuilder.go +++ b/commands/hugobuilder.go @@ -1113,7 +1113,7 @@ func (c *hugoBuilder) loadConfig(cd *simplecobra.Commandeer, running bool) error if len(conf.configs.LoadingInfo.ConfigFiles) == 0 { //lint:ignore ST1005 end user message. - return errors.New("Unable to locate config file or config directory. Perhaps you need to create a new site.\nRun `hugo help new` for details.") + return errors.New("Unable to locate config file or config directory. Perhaps you need to create a new project.\nRun `hugo help new` for details.") } c.conf = conf diff --git a/commands/import.go b/commands/import.go index dbcc556ac..a8b1b627a 100644 --- a/commands/import.go +++ b/commands/import.go @@ -49,7 +49,7 @@ func newImportCommand() *importCommand { name: "jekyll", short: "hugo import from Jekyll", long: `hugo import from Jekyll. - + Import from Jekyll requires two paths, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`.", run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error { if len(args) < 2 { @@ -90,8 +90,8 @@ func (c *importCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg func (c *importCommand) Init(cd *simplecobra.Commandeer) error { cmd := cd.CobraCommand - cmd.Short = "Import a site from another system" - cmd.Long = `Import a site from another system. + cmd.Short = "Import a project from another system" + cmd.Long = `Import a project from another system. Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`." @@ -105,7 +105,7 @@ func (c *importCommand) PreRun(cd, runner *simplecobra.Commandeer) error { } func (i *importCommand) createConfigFromJekyll(fs afero.Fs, inpath string, kind metadecoders.Format, jekyllConfig map[string]any) (err error) { - title := "My New Hugo Site" + title := "My New Hugo Project" baseURL := "http://example.org/" for key, value := range jekyllConfig { @@ -159,7 +159,7 @@ func (c *importCommand) getJekyllDirInfo(fs afero.Fs, jekyllRoot string) (map[st return postDirs, hasAnyPost } -func (c *importCommand) createSiteFromJekyll(jekyllRoot, targetDir string, jekyllPostDirs map[string]bool) error { +func (c *importCommand) createProjectFromJekyll(jekyllRoot, targetDir string, jekyllPostDirs map[string]bool) error { fs := &afero.OsFs{} if exists, _ := helpers.Exists(targetDir, fs); exists { if isDir, _ := helpers.IsDir(targetDir, fs); !isDir { @@ -419,7 +419,7 @@ func (c *importCommand) importFromJekyll(args []string) error { return errors.New("abort: jekyll root contains neither posts nor drafts") } - err = c.createSiteFromJekyll(jekyllRoot, targetDir, jekyllPostDirs) + err = c.createProjectFromJekyll(jekyllRoot, targetDir, jekyllPostDirs) if err != nil { return newUserError(err) } diff --git a/commands/mod.go b/commands/mod.go index 58155f9be..971257a1f 100644 --- a/commands/mod.go +++ b/commands/mod.go @@ -26,7 +26,7 @@ import ( ) const commonUsageMod = ` -Note that Hugo will always start out by resolving the components defined in the site +Note that Hugo will always start out by resolving the components defined in the project configuration, provided by a _vendor directory (if no --ignoreVendorPaths flag provided), Go Modules, or a folder inside the themes directory, in that order. diff --git a/commands/new.go b/commands/new.go index 08b63a866..e82258a79 100644 --- a/commands/new.go +++ b/commands/new.go @@ -46,9 +46,9 @@ It will guess which kind of file to create based on the path provided. You can also specify the kind with ` + "`-k KIND`" + `. -If archetypes are provided in your theme or site, they will be used. +If archetypes are provided in your theme or project, they will be used. -Ensure you run this within the root directory of your site.`, +Ensure you run this within the root directory of your project.`, run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error { if len(args) < 1 { return newUserError("path needs to be provided") @@ -76,10 +76,11 @@ Ensure you run this within the root directory of your site.`, }, }, &simpleCommand{ - name: "site", - use: "site [path]", - short: "Create a new site", - long: `Create a new site at the specified path.`, + name: "project", + use: "project [path]", + short: "Create a new project", + long: `Create a new project at the specified path.`, + aliases: []string{"site"}, run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error { if len(args) < 1 { return newUserError("path needs to be provided") @@ -99,13 +100,13 @@ Ensure you run this within the root directory of your site.`, } sourceFs := conf.fs.Source - err = skeletons.CreateSite(createpath, sourceFs, force, format) + err = skeletons.CreateProject(createpath, sourceFs, force, format) if err != nil { return err } - r.Printf("Congratulations! Your new Hugo site was created in %s.\n\n", createpath) - r.Println(c.newSiteNextStepsText(createpath, format)) + r.Printf("Congratulations! Your new Hugo project was created in %s.\n\n", createpath) + r.Println(c.newProjectNextStepsText(createpath, format)) return nil }, @@ -192,9 +193,9 @@ It will guess which kind of file to create based on the path provided. You can also specify the kind with ` + "`-k KIND`" + `. -If archetypes are provided in your theme or site, they will be used. +If archetypes are provided in your theme or project, they will be used. -Ensure you run this within the root directory of your site.` +Ensure you run this within the root directory of your project.` cmd.RunE = nil return nil @@ -205,7 +206,7 @@ func (c *newCommand) PreRun(cd, runner *simplecobra.Commandeer) error { return nil } -func (c *newCommand) newSiteNextStepsText(path string, format string) string { +func (c *newCommand) newProjectNextStepsText(path string, format string) string { format = strings.ToLower(format) var nextStepsText bytes.Buffer diff --git a/commands/server.go b/commands/server.go index 48e4c79fb..a9454ffc2 100644 --- a/commands/server.go +++ b/commands/server.go @@ -523,7 +523,7 @@ func (c *serverCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg func (c *serverCommand) Init(cd *simplecobra.Commandeer) error { cmd := cd.CobraCommand cmd.Short = "Start the embedded web server" - cmd.Long = `Hugo provides its own webserver which builds and serves the site. + cmd.Long = `Hugo provides its own webserver which builds and serves the project. While hugo server is high performance, it is a webserver with limited options. The ` + "`" + `hugo server` + "`" + ` command will by default write and serve files from disk, but @@ -531,8 +531,8 @@ you can render to memory by using the ` + "`" + `--renderToMemory` + "`" + ` fla faster in some cases, but it will consume more memory. By default hugo will also watch your files for any changes you make and -automatically rebuild the site. It will then live reload any open browser pages -and push the latest content to them. As most Hugo sites are built in a fraction +automatically rebuild the project. It will then live reload any open browser pages +and push the latest content to them. As most Hugo projects are built in a fraction of a second, you will be able to save and see your changes nearly instantly.` cmd.Aliases = []string{"serve"} @@ -553,7 +553,7 @@ of a second, you will be able to save and see your changes nearly instantly.` cmd.Flags().BoolVarP(&c.serverAppend, "appendPort", "", true, "append port to baseURL") cmd.Flags().BoolVar(&c.disableLiveReload, "disableLiveReload", false, "watch without enabling live browser reload on rebuild") cmd.Flags().BoolVarP(&c.navigateToChanged, "navigateToChanged", "N", false, "navigate to changed content file on live browser reload") - cmd.Flags().BoolVarP(&c.openBrowser, "openBrowser", "O", false, "open the site in a browser after server startup") + cmd.Flags().BoolVarP(&c.openBrowser, "openBrowser", "O", false, "open the project in a browser after server startup") cmd.Flags().BoolVar(&c.renderStaticToDisk, "renderStaticToDisk", false, "serve static files from disk and dynamic files from memory") cmd.Flags().BoolVar(&c.disableFastRender, "disableFastRender", false, "enables full re-renders on changes") cmd.Flags().BoolVar(&c.disableBrowserError, "disableBrowserError", false, "do not show build errors in the browser") diff --git a/common/loggers/logger.go b/common/loggers/logger.go index b49a0b746..ff84081c0 100644 --- a/common/loggers/logger.go +++ b/common/loggers/logger.go @@ -352,7 +352,7 @@ func (l *logAdapter) Warnidf(id, format string, v ...any) { } func (l *logAdapter) idfInfoStatement(what, id, format string) string { - return fmt.Sprintf("\nYou can suppress this %s by adding the following to your site configuration:\nignoreLogs = ['%s']", what, id) + return fmt.Sprintf("\nYou can suppress this %s by adding the following to your project configuration:\nignoreLogs = ['%s']", what, id) } func (l *logAdapter) Trace(s logg.StringFunc) { diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go index 6ed93a9ac..91616490a 100644 --- a/config/allconfig/allconfig.go +++ b/config/allconfig/allconfig.go @@ -401,21 +401,21 @@ func (c *Config) CompileConfig(logger loggers.Logger) error { // Legacy privacy values. if c.Privacy.Twitter.Disable { - hugo.DeprecateWithLogger("site config key privacy.twitter.disable", "Use privacy.x.disable instead.", "v0.141.0", logger.Logger()) + hugo.DeprecateWithLogger("project config key privacy.twitter.disable", "Use privacy.x.disable instead.", "v0.141.0", logger.Logger()) c.Privacy.X.Disable = c.Privacy.Twitter.Disable } if c.Privacy.Twitter.EnableDNT { - hugo.DeprecateWithLogger("site config key privacy.twitter.enableDNT", "Use privacy.x.enableDNT instead.", "v0.141.0", logger.Logger()) + hugo.DeprecateWithLogger("project config key privacy.twitter.enableDNT", "Use privacy.x.enableDNT instead.", "v0.141.0", logger.Logger()) c.Privacy.X.EnableDNT = c.Privacy.Twitter.EnableDNT } if c.Privacy.Twitter.Simple { - hugo.DeprecateWithLogger("site config key privacy.twitter.simple", "Use privacy.x.simple instead.", "v0.141.0", logger.Logger()) + hugo.DeprecateWithLogger("project config key privacy.twitter.simple", "Use privacy.x.simple instead.", "v0.141.0", logger.Logger()) c.Privacy.X.Simple = c.Privacy.Twitter.Simple } // Legacy services values. if c.Services.Twitter.DisableInlineCSS { - hugo.DeprecateWithLogger("site config key services.twitter.disableInlineCSS", "Use services.x.disableInlineCSS instead.", "v0.141.0", logger.Logger()) + hugo.DeprecateWithLogger("project config key services.twitter.disableInlineCSS", "Use services.x.disableInlineCSS instead.", "v0.141.0", logger.Logger()) c.Services.X.DisableInlineCSS = c.Services.Twitter.DisableInlineCSS } @@ -436,7 +436,7 @@ func (c *Config) CompileConfig(logger loggers.Logger) error { ) if c.Markup.Goldmark.RenderHooks.Image.EnableDefault != nil { alternative := "Use markup.goldmark.renderHooks.image.useEmbedded instead." + " " + alternativeDetails - hugo.DeprecateWithLogger("site config key markup.goldmark.renderHooks.image.enableDefault", alternative, "0.148.0", logger.Logger()) + hugo.DeprecateWithLogger("project config key markup.goldmark.renderHooks.image.enableDefault", alternative, "0.148.0", logger.Logger()) if *c.Markup.Goldmark.RenderHooks.Image.EnableDefault { c.Markup.Goldmark.RenderHooks.Image.UseEmbedded = gc.RenderHookUseEmbeddedFallback } else { @@ -445,7 +445,7 @@ func (c *Config) CompileConfig(logger loggers.Logger) error { } if c.Markup.Goldmark.RenderHooks.Link.EnableDefault != nil { alternative := "Use markup.goldmark.renderHooks.link.useEmbedded instead." + " " + alternativeDetails - hugo.DeprecateWithLogger("site config key markup.goldmark.renderHooks.link.enableDefault", alternative, "0.148.0", logger.Logger()) + hugo.DeprecateWithLogger("project config key markup.goldmark.renderHooks.link.enableDefault", alternative, "0.148.0", logger.Logger()) if *c.Markup.Goldmark.RenderHooks.Link.EnableDefault { c.Markup.Goldmark.RenderHooks.Link.UseEmbedded = gc.RenderHookUseEmbeddedFallback } else { @@ -461,10 +461,10 @@ func (c *Config) CompileConfig(logger loggers.Logger) error { gc.RenderHookUseEmbeddedNever, } if !slices.Contains(renderHookUseEmbeddedModes, c.Markup.Goldmark.RenderHooks.Image.UseEmbedded) { - return fmt.Errorf("site config markup.goldmark.renderHooks.image.useEmbedded must be one of %s", helpers.StringSliceToList(renderHookUseEmbeddedModes, "or")) + return fmt.Errorf("project config markup.goldmark.renderHooks.image.useEmbedded must be one of %s", helpers.StringSliceToList(renderHookUseEmbeddedModes, "or")) } if !slices.Contains(renderHookUseEmbeddedModes, c.Markup.Goldmark.RenderHooks.Link.UseEmbedded) { - return fmt.Errorf("site config markup.goldmark.renderHooks.link.useEmbedded must be one of %s", helpers.StringSliceToList(renderHookUseEmbeddedModes, "or")) + return fmt.Errorf("project config markup.goldmark.renderHooks.link.useEmbedded must be one of %s", helpers.StringSliceToList(renderHookUseEmbeddedModes, "or")) } c.C = &ConfigCompiled{ diff --git a/config/allconfig/load.go b/config/allconfig/load.go index b04d024b9..b8d93a8f0 100644 --- a/config/allconfig/load.go +++ b/config/allconfig/load.go @@ -39,7 +39,7 @@ import ( ) //lint:ignore ST1005 end user message. -var ErrNoConfigFile = errors.New("Unable to locate config file or config directory. Perhaps you need to create a new site.\n Run `hugo help new` for details.\n") +var ErrNoConfigFile = errors.New("Unable to locate config file or config directory. Perhaps you need to create a new project.\n Run `hugo help new` for details.\n") func LoadConfig(d ConfigSourceDescriptor) (configs *Configs, err error) { defer func() { @@ -179,12 +179,12 @@ func (l configLoader) applyDefaultConfig() error { func (l configLoader) normalizeCfg(cfg config.Provider) error { if b, ok := cfg.Get("minifyOutput").(bool); ok { - hugo.Deprecate("site config minifyOutput", "Use minify.minifyOutput instead.", "v0.150.0") + hugo.Deprecate("project config minifyOutput", "Use minify.minifyOutput instead.", "v0.150.0") if b { cfg.Set("minify.minifyOutput", true) } } else if b, ok := cfg.Get("minify").(bool); ok { - hugo.Deprecate("site config minify", "Use minify.minifyOutput instead.", "v0.150.0") + hugo.Deprecate("project config minify", "Use minify.minifyOutput instead.", "v0.150.0") if b { cfg.Set("minify", hmaps.Params{"minifyOutput": true}) } diff --git a/create/content.go b/create/content.go index 89c20242d..7c04d2f52 100644 --- a/create/content.go +++ b/create/content.go @@ -36,7 +36,7 @@ import ( ) const ( - // DefaultArchetypeTemplateTemplate is the template used in 'hugo new site' + // DefaultArchetypeTemplateTemplate is the template used in 'hugo new project' // and the template we use as a fall back. DefaultArchetypeTemplateTemplate = `--- title: "{{ replace .File.ContentBaseName "-" " " | title }}" diff --git a/create/skeletons/site/assets/.gitkeep b/create/skeletons/project/assets/.gitkeep similarity index 100% rename from create/skeletons/site/assets/.gitkeep rename to create/skeletons/project/assets/.gitkeep diff --git a/create/skeletons/site/content/.gitkeep b/create/skeletons/project/content/.gitkeep similarity index 100% rename from create/skeletons/site/content/.gitkeep rename to create/skeletons/project/content/.gitkeep diff --git a/create/skeletons/site/data/.gitkeep b/create/skeletons/project/data/.gitkeep similarity index 100% rename from create/skeletons/site/data/.gitkeep rename to create/skeletons/project/data/.gitkeep diff --git a/create/skeletons/site/i18n/.gitkeep b/create/skeletons/project/i18n/.gitkeep similarity index 100% rename from create/skeletons/site/i18n/.gitkeep rename to create/skeletons/project/i18n/.gitkeep diff --git a/create/skeletons/site/layouts/.gitkeep b/create/skeletons/project/layouts/.gitkeep similarity index 100% rename from create/skeletons/site/layouts/.gitkeep rename to create/skeletons/project/layouts/.gitkeep diff --git a/create/skeletons/site/static/.gitkeep b/create/skeletons/project/static/.gitkeep similarity index 100% rename from create/skeletons/site/static/.gitkeep rename to create/skeletons/project/static/.gitkeep diff --git a/create/skeletons/site/themes/.gitkeep b/create/skeletons/project/themes/.gitkeep similarity index 100% rename from create/skeletons/site/themes/.gitkeep rename to create/skeletons/project/themes/.gitkeep diff --git a/create/skeletons/skeletons.go b/create/skeletons/skeletons.go index a6241ef92..1989ed202 100644 --- a/create/skeletons/skeletons.go +++ b/create/skeletons/skeletons.go @@ -27,8 +27,8 @@ import ( "github.com/spf13/afero" ) -//go:embed all:site/* -var siteFs embed.FS +//go:embed all:project/* +var projectFs embed.FS //go:embed all:theme/* var themeFs embed.FS @@ -41,10 +41,10 @@ func CreateTheme(createpath string, sourceFs afero.Fs, format string) error { format = strings.ToLower(format) - siteConfig := map[string]any{ + projectConfig := map[string]any{ "baseURL": "https://example.org/", "languageCode": "en-US", - "title": "My New Hugo Site", + "title": "My New Hugo Project", "menus": map[string]any{ "main": []any{ map[string]any{ @@ -72,7 +72,7 @@ func CreateTheme(createpath string, sourceFs afero.Fs, format string) error { }, } - err := createSiteConfig(sourceFs, createpath, siteConfig, format) + err := createProjectConfig(sourceFs, createpath, projectConfig, format) if err != nil { return err } @@ -91,8 +91,8 @@ func CreateTheme(createpath string, sourceFs afero.Fs, format string) error { return copyFiles(createpath, sourceFs, themeFs) } -// CreateSite creates a site skeleton. -func CreateSite(createpath string, sourceFs afero.Fs, force bool, format string) error { +// CreateProject creates a project skeleton. +func CreateProject(createpath string, sourceFs afero.Fs, force bool, format string) error { format = strings.ToLower(format) if exists, _ := helpers.Exists(createpath, sourceFs); exists { if isDir, _ := helpers.IsDir(createpath, sourceFs); !isDir { @@ -106,7 +106,7 @@ func CreateSite(createpath string, sourceFs afero.Fs, force bool, format string) return errors.New(createpath + " already exists and is not empty. See --force.") case !isEmpty && force: var all []string - fs.WalkDir(siteFs, ".", func(path string, d fs.DirEntry, err error) error { + fs.WalkDir(projectFs, ".", func(path string, d fs.DirEntry, err error) error { if d.IsDir() && path != "." { all = append(all, path) } @@ -121,13 +121,13 @@ func CreateSite(createpath string, sourceFs afero.Fs, force bool, format string) } } - siteConfig := map[string]any{ + projectConfig := map[string]any{ "baseURL": "https://example.org/", - "title": "My New Hugo Site", + "title": "My New Hugo Project", "languageCode": "en-us", } - err := createSiteConfig(sourceFs, createpath, siteConfig, format) + err := createProjectConfig(sourceFs, createpath, projectConfig, format) if err != nil { return err } @@ -143,7 +143,7 @@ func CreateSite(createpath string, sourceFs afero.Fs, force bool, format string) return err } - return copyFiles(createpath, sourceFs, siteFs) + return copyFiles(createpath, sourceFs, projectFs) } func copyFiles(createpath string, sourceFs afero.Fs, skeleton embed.FS) error { @@ -161,7 +161,7 @@ func copyFiles(createpath string, sourceFs afero.Fs, skeleton embed.FS) error { }) } -func createSiteConfig(fs afero.Fs, createpath string, in map[string]any, format string) (err error) { +func createProjectConfig(fs afero.Fs, createpath string, in map[string]any, format string) (err error) { var buf bytes.Buffer err = parser.InterfaceToConfig(in, metadecoders.FormatFromString(format), &buf) if err != nil { diff --git a/hugolib/hugo_smoke_test.go b/hugolib/hugo_smoke_test.go index bf6d25949..b32af4f44 100644 --- a/hugolib/hugo_smoke_test.go +++ b/hugolib/hugo_smoke_test.go @@ -151,7 +151,7 @@ myshortcode.en.html "Parent: |", ) b.AssertFileContent("public/nn/index.html", - "Site title nn|", // from site config. + "Site title nn|", // from project config. "Lastmod: 2024-10-01", "RenderString with shortcode: myshortcode.html", ) diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 903ee7fc7..6783bc128 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -887,7 +887,7 @@ func TestContentProviderWithCustomOutputFormat(t *testing.T) { files := ` -- hugo.toml -- baseURL = 'http://example.org/' -title = 'My New Hugo Site' +title = 'My New Hugo Project' timeout = 600000 # ten minutes in case we want to pause and debug @@ -1803,7 +1803,7 @@ baseURL = "https://example.org" Author page: {{ $withParam.Param "author.name" }} Author name page string: {{ $withStringParam.Param "author.name" }}| Author page string: {{ $withStringParam.Param "author" }}| -Author site config: {{ $noParam.Param "author.name" }} +Author project config: {{ $noParam.Param "author.name" }} -- content/withparam.md -- +++ @@ -1835,7 +1835,7 @@ author = "Jo Nesbø" "Author page: Ernest Miller Hemingway", "Author name page string: Kurt Vonnegut|", "Author page string: Jo Nesbø|", - "Author site config: Kurt Vonnegut") + "Author project config: Kurt Vonnegut") } func TestGoldmark(t *testing.T) { diff --git a/hugolib/pagecollections_test.go b/hugolib/pagecollections_test.go index d8b518626..31af55260 100644 --- a/hugolib/pagecollections_test.go +++ b/hugolib/pagecollections_test.go @@ -316,7 +316,7 @@ categories: func TestGetPageIndexIndex(t *testing.T) { files := ` -- hugo.toml -- -disableKinds = ["taxonomy", "term"] +disableKinds = ["taxonomy", "term"] -- content/mysect/index/index.md -- --- title: "Mysect Index" @@ -525,7 +525,7 @@ p1/index.md: {{ with .GetPage "p1/index.md" }}{{ .Title }}{{ end }}| `) b.AssertFileContent("public/s1/p2/index.html", ` -../p2: p2_root| +../p2: p2_root| ../p2.md: p2_root| p1/index.md: p1| ../s2/p3/index.md: p3| @@ -616,7 +616,7 @@ func TestGetPageMultilingual(t *testing.T) { baseURL = "http://example.org/" languageCode = "en-us" defaultContentLanguage = "ru" -title = "My New Hugo Site" +title = "My New Hugo Project" uglyurls = true [languages] @@ -667,7 +667,7 @@ func TestRegularPagesRecursive(t *testing.T) { files := ` -- hugo.toml -- baseURL = "http://example.org/" -title = "My New Hugo Site" +title = "My New Hugo Project" -- content/docs/1.md -- --- title: docs1 diff --git a/hugolib/rebuild_test.go b/hugolib/rebuild_test.go index 19c2b3098..afa8e326c 100644 --- a/hugolib/rebuild_test.go +++ b/hugolib/rebuild_test.go @@ -485,7 +485,7 @@ My short. func TestRebuildBaseof(t *testing.T) { files := ` -- hugo.toml -- -title = "Hugo Site" +title = "Hugo Project" baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true @@ -498,11 +498,11 @@ Home: {{ .Title }}|{{ .Content }}| {{ end }} ` testRebuildBothWatchingAndRunning(t, files, func(b *IntegrationTestBuilder) { - b.AssertFileContent("public/index.html", "Baseof: Hugo Site|", "Home: Hugo Site||") + b.AssertFileContent("public/index.html", "Baseof: Hugo Project|", "Home: Hugo Project||") b.EditFileReplaceFunc("layouts/baseof.html", func(s string) string { return strings.Replace(s, "Baseof", "Baseof Edited", 1) }).Build() - b.AssertFileContent("public/index.html", "Baseof Edited: Hugo Site|", "Home: Hugo Site||") + b.AssertFileContent("public/index.html", "Baseof Edited: Hugo Project|", "Home: Hugo Project||") }) } @@ -511,7 +511,7 @@ func TestRebuildSingle(t *testing.T) { files := ` -- hugo.toml -- -title = "Hugo Site" +title = "Hugo Project" baseURL = "https://example.com" disableKinds = ["term", "taxonomy", "sitemap", "robotstxt", "404"] disableLiveReload = true @@ -547,7 +547,7 @@ func TestRebuildSingleWithBaseofEditSingle(t *testing.T) { files := ` -- hugo.toml -- -title = "Hugo Site" +title = "Hugo Project" baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true @@ -583,7 +583,7 @@ func TestRebuildSingleWithBaseofEditBaseof(t *testing.T) { files := ` -- hugo.toml -- -title = "Hugo Site" +title = "Hugo Project" baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true @@ -618,7 +618,7 @@ func TestRebuildWithDeferEditRenderHook(t *testing.T) { files := ` -- hugo.toml -- -title = "Hugo Site" +title = "Hugo Project" baseURL = "https://example.com" disableKinds = ["term", "taxonomy"] disableLiveReload = true @@ -926,7 +926,7 @@ Len RegularPagesRecursive: {{ len .RegularPagesRecursive }} Site.Lastmod: {{ .Site.Lastmod.Format "2006-01-02" }}| Paginate: {{ range (.Paginate .Site.RegularPages).Pages }}{{ .RelPermalink }}|{{ .Title }}|{{ end }}$ -- layouts/single.html -- -Single: .Site: {{ .Site }} +Single: .Site: {{ .Site }} Single: {{ .Title }}|{{ .Content }}| Single Partial Cached: {{ partialCached "pcached" . }}| Page.Lastmod: {{ .Lastmod.Format "2006-01-02" }}| diff --git a/hugolib/rendershortcodes_test.go b/hugolib/rendershortcodes_test.go index a961680a9..9c2966d5b 100644 --- a/hugolib/rendershortcodes_test.go +++ b/hugolib/rendershortcodes_test.go @@ -375,7 +375,7 @@ Hello world. Some **bold** text. Some Unicode: 神真美好. b := TestRunning(t, files, TestOptWarn()) b.AssertNoRenderShortcodesArtifacts() - b.AssertLogContains(filepath.ToSlash("WARN .RenderShortcodes detected inside HTML block in \"/content/p1.md\"; this may not be what you intended, see https://gohugo.io/methods/page/rendershortcodes/#limitations\nYou can suppress this warning by adding the following to your site configuration:\nignoreLogs = ['warning-rendershortcodes-in-html']")) + b.AssertLogContains(filepath.ToSlash("WARN .RenderShortcodes detected inside HTML block in \"/content/p1.md\"; this may not be what you intended, see https://gohugo.io/methods/page/rendershortcodes/#limitations\nYou can suppress this warning by adding the following to your project configuration:\nignoreLogs = ['warning-rendershortcodes-in-html']")) b.AssertFileContent("public/p1/index.html", "