mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-14 20:33:59 +02:00
@@ -23,7 +23,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bep/simplecobra"
|
"github.com/bep/simplecobra"
|
||||||
"github.com/gohugoio/hugo/config"
|
|
||||||
"github.com/gohugoio/hugo/hugolib"
|
"github.com/gohugoio/hugo/hugolib"
|
||||||
"github.com/gohugoio/hugo/resources/page"
|
"github.com/gohugoio/hugo/resources/page"
|
||||||
"github.com/gohugoio/hugo/resources/resource"
|
"github.com/gohugoio/hugo/resources/resource"
|
||||||
@@ -46,7 +45,7 @@ func newListCommand() *listCommand {
|
|||||||
|
|
||||||
list := func(cd *simplecobra.Commandeer, r *rootCommand, shouldInclude func(page.Page) bool, opts ...any) error {
|
list := func(cd *simplecobra.Commandeer, r *rootCommand, shouldInclude func(page.Page) bool, opts ...any) error {
|
||||||
bcfg := hugolib.BuildCfg{SkipRender: true}
|
bcfg := hugolib.BuildCfg{SkipRender: true}
|
||||||
cfg := config.New()
|
cfg := flagsToCfg(cd, nil)
|
||||||
for i := 0; i < len(opts); i += 2 {
|
for i := 0; i < len(opts); i += 2 {
|
||||||
cfg.Set(opts[i].(string), opts[i+1])
|
cfg.Set(opts[i].(string), opts[i+1])
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,9 @@ stdout 'expired.md'
|
|||||||
stdout 'draftexpired.md'
|
stdout 'draftexpired.md'
|
||||||
stdout 'draftfuture.md'
|
stdout 'draftfuture.md'
|
||||||
|
|
||||||
|
hugo list expired --clock 2000-01-01T00:00:00Z
|
||||||
|
! stdout 'expired.md'
|
||||||
|
|
||||||
-- hugo.toml --
|
-- hugo.toml --
|
||||||
baseURL = "https://example.org/"
|
baseURL = "https://example.org/"
|
||||||
disableKinds = ["taxonomy", "term"]
|
disableKinds = ["taxonomy", "term"]
|
||||||
|
Reference in New Issue
Block a user