diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-01-04 15:07:10 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-01-04 19:10:39 +0300 |
commit | 2b6063c3e388056597af88709ff017d15f53c962 (patch) | |
tree | a86d4dde3cd5b7df5bb5738a248a0da0c5f640fd /commands | |
parent | 56ab83a59712725e1ce0dd3fd516cc7c190c8478 (diff) |
Misc depreation updates
* Deprecate .Page.Path when backed by a file
* site.Permalinks
* --ignoreVendor (use --ignoreVendorPaths)
Closes #9348
Closes #9349
Diffstat (limited to 'commands')
-rw-r--r-- | commands/commands.go | 4 | ||||
-rw-r--r-- | commands/commands_test.go | 10 | ||||
-rw-r--r-- | commands/convert.go | 6 | ||||
-rw-r--r-- | commands/hugo.go | 4 | ||||
-rw-r--r-- | commands/mod.go | 2 |
5 files changed, 5 insertions, 21 deletions
diff --git a/commands/commands.go b/commands/commands.go index 4153c3cdf..b6e8dd469 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -131,8 +131,7 @@ type hugoCmd struct { var _ cmder = (*nilCommand)(nil) -type nilCommand struct { -} +type nilCommand struct{} func (c *nilCommand) getCommand() *cobra.Command { return nil @@ -281,7 +280,6 @@ func (cc *hugoBuilderCommon) handleCommonBuilderFlags(cmd *cobra.Command) { cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{}) cmd.PersistentFlags().StringVarP(&cc.environment, "environment", "e", "", "build environment") cmd.PersistentFlags().StringP("themesDir", "", "", "filesystem path to themes directory") - cmd.PersistentFlags().BoolP("ignoreVendor", "", false, "ignores any _vendor directory") cmd.PersistentFlags().StringP("ignoreVendorPaths", "", "", "ignores any _vendor for module paths matching the given Glob pattern") } diff --git a/commands/commands_test.go b/commands/commands_test.go index ef61dc7a5..9966cd937 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -164,16 +164,6 @@ func TestFlags(t *testing.T) { }{ { // https://github.com/gohugoio/hugo/issues/7642 - name: "ignoreVendor as bool", - args: []string{"server", "--ignoreVendor"}, - check: func(c *qt.C, cmd *serverCmd) { - cfg := config.New() - cmd.flagsToConfig(cfg) - c.Assert(cfg.Get("ignoreVendor"), qt.Equals, true) - }, - }, - { - // https://github.com/gohugoio/hugo/issues/7642 name: "ignoreVendorPaths", args: []string{"server", "--ignoreVendorPaths=github.com/**"}, check: func(c *qt.C, cmd *serverCmd) { diff --git a/commands/convert.go b/commands/convert.go index e2bd4307f..8c84423f5 100644 --- a/commands/convert.go +++ b/commands/convert.go @@ -142,7 +142,7 @@ func (cc *convertCmd) convertAndSavePage(p page.Page, site *hugolib.Site, target return nil } - errMsg := fmt.Errorf("Error processing file %q", p.Path()) + errMsg := fmt.Errorf("Error processing file %q", p.File().Path()) site.Log.Infoln("Attempting to convert", p.File().Filename()) @@ -185,10 +185,10 @@ func (cc *convertCmd) convertAndSavePage(p page.Page, site *hugolib.Site, target newFilename := p.File().Filename() if cc.outputDir != "" { - contentDir := strings.TrimSuffix(newFilename, p.Path()) + contentDir := strings.TrimSuffix(newFilename, p.File().Path()) contentDir = filepath.Base(contentDir) - newFilename = filepath.Join(cc.outputDir, contentDir, p.Path()) + newFilename = filepath.Join(cc.outputDir, contentDir, p.File().Path()) } fs := hugofs.Os diff --git a/commands/hugo.go b/commands/hugo.go index d442a62b5..b954bf13c 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -199,7 +199,6 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) { "forceSyncStatic", "noTimes", "noChmod", - "ignoreVendor", "ignoreVendorPaths", "templateMetrics", "templateMetricsHints", @@ -281,7 +280,6 @@ func isTerminal() bool { } func (c *commandeer) fullBuild(noBuildLock bool) error { - var ( g errgroup.Group langCount map[string]uint64 @@ -542,7 +540,6 @@ func (c *commandeer) build() error { } func (c *commandeer) serverBuild() error { - stopProfiling, err := c.initProfiling() if err != nil { return err @@ -739,7 +736,6 @@ func (c *commandeer) handleBuildErr(err error, msg string) { } func (c *commandeer) rebuildSites(events []fsnotify.Event) error { - c.buildErr = nil visited := c.visitedURLs.PeekAllSet() if c.fastRenderMode { diff --git a/commands/mod.go b/commands/mod.go index eb6b1a440..44a48bf79 100644 --- a/commands/mod.go +++ b/commands/mod.go @@ -96,7 +96,7 @@ func (b *commandsBuilder) newModCmd() *modCmd { const commonUsage = ` Note that Hugo will always start out by resolving the components defined in the site -configuration, provided by a _vendor directory (if no --ignoreVendor flag provided), +configuration, provided by a _vendor directory (if no --ignoreVendorPaths flag provided), Go Modules, or a folder inside the themes directory, in that order. See https://gohugo.io/hugo-modules/ for more information. |