Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions cache/filecache/filecache_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ var defaultCacheConfig = FileCacheConfig{
}

const (
CacheKeyGetJSON = "getjson"
CacheKeyGetCSV = "getcsv"
CacheKeyImages = "images"
CacheKeyAssets = "assets"
CacheKeyModules = "modules"
Expand Down Expand Up @@ -74,8 +72,6 @@ var defaultCacheConfigs = Configs{
MaxAge: 24 * time.Hour,
Dir: ":cacheDir/modules",
},
CacheKeyGetJSON: defaultCacheConfig,
CacheKeyGetCSV: defaultCacheConfig,
CacheKeyImages: {
MaxAge: -1,
Dir: resourcesGenDir,
Expand Down Expand Up @@ -130,16 +126,6 @@ func (c FileCacheConfig) MarshalJSON() ([]byte, error) {
})
}

// GetJSONCache gets the file cache for getJSON.
func (f Caches) GetJSONCache() *Cache {
return f[CacheKeyGetJSON]
}

// GetCSVCache gets the file cache for getCSV.
func (f Caches) GetCSVCache() *Cache {
return f[CacheKeyGetCSV]
}

// ImageCache gets the file cache for processed images.
func (f Caches) ImageCache() *Cache {
return f[CacheKeyImages]
Expand Down
28 changes: 11 additions & 17 deletions cache/filecache/filecache_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ assetDir = "assets"
archetypeDir = "archetypes"

[caches]
[caches.getJSON]
[caches.misc]
maxAge = "10m"
dir = "/path/to/c1"
[caches.getCSV]
maxAge = "11h"
dir = "/path/to/c2"
[caches.images]
dir = "/path/to/c3"
[caches.getResource]
Expand All @@ -60,11 +57,11 @@ dir = "/path/to/c4"
c.Assert(err, qt.IsNil)
fs := afero.NewMemMapFs()
decoded := testconfig.GetTestConfigs(fs, cfg).Base.Caches
c.Assert(len(decoded), qt.Equals, 8)
c.Assert(len(decoded), qt.Equals, 6)

c2 := decoded["getcsv"]
c.Assert(c2.MaxAge.String(), qt.Equals, "11h0m0s")
c.Assert(c2.DirCompiled, qt.Equals, filepath.FromSlash("/path/to/c2/filecache/getcsv"))
c2 := decoded["misc"]
c.Assert(c2.MaxAge.String(), qt.Equals, "10m0s")
c.Assert(c2.DirCompiled, qt.Equals, filepath.FromSlash("/path/to/c1/filecache/misc"))

c3 := decoded["images"]
c.Assert(c3.MaxAge, qt.Equals, time.Duration(-1))
Expand All @@ -91,12 +88,9 @@ archeTypedir = "archetypes"

ignoreCache = true
[caches]
[caches.getJSON]
[caches.misc]
maxAge = 1234
dir = "/path/to/c1"
[caches.getCSV]
maxAge = 3456
dir = "/path/to/c2"
[caches.images]
dir = "/path/to/c3"
[caches.getResource]
Expand All @@ -107,7 +101,7 @@ dir = "/path/to/c4"
c.Assert(err, qt.IsNil)
fs := afero.NewMemMapFs()
decoded := testconfig.GetTestConfigs(fs, cfg).Base.Caches
c.Assert(len(decoded), qt.Equals, 8)
c.Assert(len(decoded), qt.Equals, 6)

for _, v := range decoded {
c.Assert(v.MaxAge, qt.Equals, time.Duration(0))
Expand All @@ -130,20 +124,20 @@ func TestDecodeConfigDefault(t *testing.T) {

fs := afero.NewMemMapFs()
decoded := testconfig.GetTestConfigs(fs, cfg).Base.Caches
c.Assert(len(decoded), qt.Equals, 8)
c.Assert(len(decoded), qt.Equals, 6)

imgConfig := decoded[filecache.CacheKeyImages]
jsonConfig := decoded[filecache.CacheKeyGetJSON]
miscConfig := decoded[filecache.CacheKeyMisc]

if runtime.GOOS == "windows" {
c.Assert(imgConfig.DirCompiled, qt.Equals, filepath.FromSlash("_gen/images"))
} else {
c.Assert(imgConfig.DirCompiled, qt.Equals, "_gen/images")
c.Assert(jsonConfig.DirCompiled, qt.Equals, "/cache/thecache/hugoproject/filecache/getjson")
c.Assert(miscConfig.DirCompiled, qt.Equals, "/cache/thecache/hugoproject/filecache/misc")
}

c.Assert(imgConfig.IsResourceDir, qt.Equals, true)
c.Assert(jsonConfig.IsResourceDir, qt.Equals, false)
c.Assert(miscConfig.IsResourceDir, qt.Equals, false)
}

func TestFileCacheConfigMarshalJSON(t *testing.T) {
Expand Down
7 changes: 2 additions & 5 deletions cache/filecache/filecache_pruner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ assetDir = "assets"
archeTypedir = "archetypes"

[caches]
[caches.getjson]
[caches.misc]
maxAge = "200ms"
dir = "/cache/c"
[caches.getcsv]
maxAge = "200ms"
dir = "/cache/d"
[caches.assets]
maxAge = "200ms"
dir = ":resourceDir/_gen"
Expand All @@ -53,7 +50,7 @@ maxAge = "200ms"
dir = ":resourceDir/_gen"
`

for _, name := range []string{filecache.CacheKeyGetCSV, filecache.CacheKeyGetJSON, filecache.CacheKeyAssets, filecache.CacheKeyImages} {
for _, name := range []string{filecache.CacheKeyAssets, filecache.CacheKeyImages} {
msg := qt.Commentf("cache: %s", name)
fs := afero.NewMemMapFs()
p := newPathsSpec(t, fs, configStr)
Expand Down
16 changes: 7 additions & 9 deletions cache/filecache/filecache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (
"fmt"
"io"
"strings"

"github.com/gohugoio/hugo/htesting"
"sync"
"testing"
"time"

"github.com/gohugoio/hugo/htesting"

"github.com/gohugoio/hugo/cache/filecache"
"github.com/gohugoio/hugo/common/hugio"
"github.com/gohugoio/hugo/config"
Expand Down Expand Up @@ -66,7 +66,7 @@ assetDir = "assets"
archeTypedir = "archetypes"
[caches]
[caches.getJSON]
[caches.misc]
maxAge = "10h"
dir = ":cacheDir/c"
Expand All @@ -86,7 +86,7 @@ dir = ":cacheDir/c"
c.Assert(err, qt.IsNil)
caches.SetResourceFs(p.SourceFs)

cache := caches.Get("GetJSON")
cache := caches.Get("Misc")
c.Assert(cache, qt.Not(qt.IsNil))

cache = caches.Get("Images")
Expand All @@ -108,7 +108,7 @@ dir = ":cacheDir/c"
return []byte("bcd"), nil
}

for _, ca := range []*filecache.Cache{caches.ImageCache(), caches.AssetsCache(), caches.GetJSONCache(), caches.GetCSVCache()} {
for _, ca := range []*filecache.Cache{caches.ImageCache(), caches.AssetsCache()} {
for range 2 {
info, r, err := ca.GetOrCreate("a", rf("abc"))
Comment on lines 109 to 113
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test still depends on the getJSON cache (configured via [caches.getJSON] and accessed via caches.Get("GetJSON")/caches.Get("getJSON") later in the test). Since this PR removes the getjson/getcsv cache keys from filecache_config.go, the cache config should now be rejected or omitted, which will make this test fail. Update the test to use a supported cache key (e.g. misc or getResource) and adjust the assertions accordingly; same issue applies to TestFileCacheConcurrent which uses cacheName = "getjson".

Copilot uses AI. Check for mistakes.
c.Assert(err, qt.IsNil)
Expand Down Expand Up @@ -136,8 +136,6 @@ dir = ":cacheDir/c"
}
}

c.Assert(caches.Get("getJSON"), qt.Not(qt.IsNil))

info, w, err := caches.ImageCache().WriteCloser("mykey")
c.Assert(err, qt.IsNil)
c.Assert(info.Name, qt.Equals, "mykey")
Expand Down Expand Up @@ -177,7 +175,7 @@ assetDir = "assets"
archeTypedir = "archetypes"
[caches]
[caches.getjson]
[caches.misc]
maxAge = "1s"
dir = "/cache/c"
Expand All @@ -189,7 +187,7 @@ dir = "/cache/c"
c.Assert(err, qt.IsNil)
caches.SetResourceFs(p.Fs.Source)

const cacheName = "getjson"
const cacheName = "misc"

filenameData := func(i int) (string, string) {
data := fmt.Sprintf("data: %d", i)
Expand Down
4 changes: 2 additions & 2 deletions common/hugo/hugo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ func TestDeprecationLogLevelFromVersion(t *testing.T) {
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelError)

// Added just to find the threshold for where we can remove deprecated items.
// Subtract 5 from the minor version of the first ERRORed version => 0.122.0.
c.Assert(deprecationLogLevelFromVersion("0.127.0"), qt.Equals, logg.LevelError)
// Subtract 5 from the minor version of the first ERRORed version => 0.136.0.
c.Assert(deprecationLogLevelFromVersion("0.141.0"), qt.Equals, logg.LevelError)
}

func TestMarkupScope(t *testing.T) {
Expand Down
18 changes: 0 additions & 18 deletions config/allconfig/allconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,6 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
return err
}

// Legacy paginate values.
if c.Paginate != 0 {
hugo.DeprecateWithLogger("site config key paginate", "Use pagination.pagerSize instead.", "v0.128.0", logger.Logger())
c.Pagination.PagerSize = c.Paginate
}
if c.PaginatePath != "" {
hugo.DeprecateWithLogger("site config key paginatePath", "Use pagination.path instead.", "v0.128.0", logger.Logger())
c.Pagination.Path = c.PaginatePath
}

// 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())
Expand Down Expand Up @@ -687,14 +677,6 @@ type RootConfig struct {
// Enable if the site content has CJK language (Chinese, Japanese, or Korean). This affects how Hugo counts words.
HasCJKLanguage bool

// The default number of pages per page when paginating.
// Deprecated: Use the Pagination struct.
Paginate int

// The path to use when creating pagination URLs, e.g. "page" in /page/2/.
// Deprecated: Use the Pagination struct.
PaginatePath string

// Whether to pluralize default list titles.
// Note that this currently only works for English, but you can provide your own title in the content file's front matter.
PluralizeListTitles bool
Expand Down
4 changes: 0 additions & 4 deletions hugolib/hugo_sites.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,6 @@ func (h *HugoSites) filterAndJoinErrors(errs []error) error {
return errors.Join(errs...)
}

func (h *HugoSites) isMultilingual() bool {
return len(h.Sites) > 1
}

// TODO(bep) consolidate
func (h *HugoSites) LanguageSet() map[string]int {
set := make(map[string]int)
Expand Down
13 changes: 0 additions & 13 deletions hugolib/page__position.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"context"

"github.com/gohugoio/hugo/common/hsync"
"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/resources/page"
)

Expand Down Expand Up @@ -53,22 +52,10 @@ func (p pagePosition) Next() page.Page {
return p.next()
}

// Deprecated: Use Next instead.
func (p pagePosition) NextPage() page.Page {
hugo.Deprecate(".Page.NextPage", "Use .Page.Next instead.", "v0.123.0")
return p.Next()
}

func (p pagePosition) Prev() page.Page {
return p.prev()
}

// Deprecated: Use Prev instead.
func (p pagePosition) PrevPage() page.Page {
hugo.Deprecate(".Page.PrevPage", "Use .Page.Prev instead.", "v0.123.0")
return p.Prev()
}

type pagePositionInSection struct {
*nextPrev
}
Expand Down
33 changes: 0 additions & 33 deletions hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,6 @@ func (s *Site) BaseURL() string {
return s.conf.C.BaseURL.WithPath
}

// Deprecated: Use .Site.Lastmod instead.
func (s *Site) LastChange() time.Time {
s.CheckReady()
hugo.Deprecate(".Site.LastChange", "Use .Site.Lastmod instead.", "v0.123.0")
return s.lastmod
}

// Returns the last modification date of the content.
func (s *Site) Lastmod() time.Time {
return s.lastmod
Expand All @@ -680,26 +673,6 @@ func (s *Site) Params() hmaps.Params {
return s.conf.Params
}

// Deprecated: Use taxonomies instead.
func (s *Site) Author() map[string]any {
if len(s.conf.Author) != 0 {
hugo.Deprecate(".Site.Author", "Implement taxonomy 'author' or use .Site.Params.Author instead.", "v0.124.0")
}
return s.conf.Author
}

// Deprecated: Use taxonomies instead.
func (s *Site) Authors() page.AuthorList {
hugo.Deprecate(".Site.Authors", "Implement taxonomy 'authors' or use .Site.Params.Author instead.", "v0.124.0")
return page.AuthorList{}
}

// Deprecated: Use .Site.Params instead.
func (s *Site) Social() map[string]string {
hugo.Deprecate(".Site.Social", "Implement taxonomy 'social' or use .Site.Params.Social instead.", "v0.124.0")
return s.conf.Social
}

func (s *Site) Param(key any) (any, error) {
return resource.Param(s, nil, key)
}
Expand All @@ -713,12 +686,6 @@ func (s *Site) BuildDrafts() bool {
return s.conf.BuildDrafts
}

// Deprecated: Use hugo.IsMultilingual instead.
func (s *Site) IsMultiLingual() bool {
hugo.Deprecate(".Site.IsMultiLingual", "Use hugo.IsMultilingual instead.", "v0.124.0")
return s.h.isMultilingual()
}

func (s *Site) LanguagePrefix() string {
prefix := s.GetLanguagePrefix()
if prefix == "" {
Expand Down
6 changes: 0 additions & 6 deletions resources/page/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,6 @@ type Positioner interface {
Next() Page
// Prev points down to the previous regular page (sorted by Hugo’s default sort).
Prev() Page

// Deprecated: Use Prev. Will be removed in Hugo 0.57
PrevPage() Page

// Deprecated: Use Next. Will be removed in Hugo 0.57
NextPage() Page
}

// RawContentProvider provides the raw, unprocessed content of the page.
Expand Down
8 changes: 0 additions & 8 deletions resources/page/page_nop.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,6 @@ func (p *nopPage) NextInSection() Page {
return nil
}

func (p *nopPage) PrevPage() Page {
return nil
}

func (p *nopPage) NextPage() Page {
return nil
}

func (p *nopPage) RawContent() string {
return ""
}
Expand Down
8 changes: 0 additions & 8 deletions resources/page/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"math"
"reflect"

"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/config"

"github.com/spf13/cast"
Expand Down Expand Up @@ -194,13 +193,6 @@ func (p *Paginator) Pagers() pagers {
return p.pagers
}

// PageSize returns the size of each paginator page.
// Deprecated: Use PagerSize instead.
func (p *Paginator) PageSize() int {
hugo.Deprecate("PageSize", "Use PagerSize instead.", "v0.128.0")
return p.size
}

// PagerSize returns the size of each paginator page.
func (p *Paginator) PagerSize() int {
return p.size
Expand Down
Loading