Skip to content

Commit 73df2a3

Browse files
bepclaude
andcommitted
Remove items deprecated <= v0.136.0
Template functions: - data.GetCSV / getCSV (use resources.GetRemote) - data.GetJSON / getJSON (use resources.GetRemote) - crypto.FNV32a (use hash.FNV32a) - resources.Babel (use js.Babel) - resources.PostCSS (use css.PostCSS) - resources.ToCSS (use css.Sass) Page methods: - .Page.NextPage (use .Page.Next) - .Page.PrevPage (use .Page.Prev) Paginator: - .Paginator.PageSize (use .Paginator.PagerSize) Site methods: - .Site.LastChange (use .Site.Lastmod) - .Site.Author (use .Site.Params.Author) - .Site.Authors (use .Site.Params.Authors) - .Site.Social (use .Site.Params.Social) - .Site.IsMultiLingual (use hugo.IsMultilingual) - .Sites.First (use .Sites.Default) Site config: - paginate (use pagination.pagerSize) - paginatePath (use pagination.path) File caches: - getjson cache - getcsv cache Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ee91280 commit 73df2a3

File tree

22 files changed

+9
-1202
lines changed

22 files changed

+9
-1202
lines changed

cache/filecache/filecache_config.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ var defaultCacheConfig = FileCacheConfig{
4141
}
4242

4343
const (
44-
CacheKeyGetJSON = "getjson"
45-
CacheKeyGetCSV = "getcsv"
4644
CacheKeyImages = "images"
4745
CacheKeyAssets = "assets"
4846
CacheKeyModules = "modules"
@@ -74,8 +72,6 @@ var defaultCacheConfigs = Configs{
7472
MaxAge: 24 * time.Hour,
7573
Dir: ":cacheDir/modules",
7674
},
77-
CacheKeyGetJSON: defaultCacheConfig,
78-
CacheKeyGetCSV: defaultCacheConfig,
7975
CacheKeyImages: {
8076
MaxAge: -1,
8177
Dir: resourcesGenDir,
@@ -130,16 +126,6 @@ func (c FileCacheConfig) MarshalJSON() ([]byte, error) {
130126
})
131127
}
132128

133-
// GetJSONCache gets the file cache for getJSON.
134-
func (f Caches) GetJSONCache() *Cache {
135-
return f[CacheKeyGetJSON]
136-
}
137-
138-
// GetCSVCache gets the file cache for getCSV.
139-
func (f Caches) GetCSVCache() *Cache {
140-
return f[CacheKeyGetCSV]
141-
}
142-
143129
// ImageCache gets the file cache for processed images.
144130
func (f Caches) ImageCache() *Cache {
145131
return f[CacheKeyImages]

cache/filecache/filecache_config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ func TestDecodeConfigDefault(t *testing.T) {
130130

131131
fs := afero.NewMemMapFs()
132132
decoded := testconfig.GetTestConfigs(fs, cfg).Base.Caches
133-
c.Assert(len(decoded), qt.Equals, 8)
133+
c.Assert(len(decoded), qt.Equals, 6)
134134

135135
imgConfig := decoded[filecache.CacheKeyImages]
136-
jsonConfig := decoded[filecache.CacheKeyGetJSON]
136+
jsonConfig := decoded[filecache.CacheKeyMisc]
137137

138138
if runtime.GOOS == "windows" {
139139
c.Assert(imgConfig.DirCompiled, qt.Equals, filepath.FromSlash("_gen/images"))
140140
} else {
141141
c.Assert(imgConfig.DirCompiled, qt.Equals, "_gen/images")
142-
c.Assert(jsonConfig.DirCompiled, qt.Equals, "/cache/thecache/hugoproject/filecache/getjson")
142+
c.Assert(jsonConfig.DirCompiled, qt.Equals, "/cache/thecache/hugoproject/filecache/misc")
143143
}
144144

145145
c.Assert(imgConfig.IsResourceDir, qt.Equals, true)

cache/filecache/filecache_pruner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ maxAge = "200ms"
5353
dir = ":resourceDir/_gen"
5454
`
5555

56-
for _, name := range []string{filecache.CacheKeyGetCSV, filecache.CacheKeyGetJSON, filecache.CacheKeyAssets, filecache.CacheKeyImages} {
56+
for _, name := range []string{filecache.CacheKeyAssets, filecache.CacheKeyImages} {
5757
msg := qt.Commentf("cache: %s", name)
5858
fs := afero.NewMemMapFs()
5959
p := newPathsSpec(t, fs, configStr)

cache/filecache/filecache_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import (
1818
"fmt"
1919
"io"
2020
"strings"
21-
22-
"github.com/gohugoio/hugo/htesting"
2321
"sync"
2422
"testing"
2523
"time"
2624

25+
"github.com/gohugoio/hugo/htesting"
26+
2727
"github.com/gohugoio/hugo/cache/filecache"
2828
"github.com/gohugoio/hugo/common/hugio"
2929
"github.com/gohugoio/hugo/config"
@@ -108,7 +108,7 @@ dir = ":cacheDir/c"
108108
return []byte("bcd"), nil
109109
}
110110

111-
for _, ca := range []*filecache.Cache{caches.ImageCache(), caches.AssetsCache(), caches.GetJSONCache(), caches.GetCSVCache()} {
111+
for _, ca := range []*filecache.Cache{caches.ImageCache(), caches.AssetsCache()} {
112112
for range 2 {
113113
info, r, err := ca.GetOrCreate("a", rf("abc"))
114114
c.Assert(err, qt.IsNil)

common/hugo/hugo_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ func TestDeprecationLogLevelFromVersion(t *testing.T) {
6666
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelError)
6767

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

7373
func TestMarkupScope(t *testing.T) {

config/allconfig/allconfig.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,6 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
399399
return err
400400
}
401401

402-
// Legacy paginate values.
403-
if c.Paginate != 0 {
404-
hugo.DeprecateWithLogger("site config key paginate", "Use pagination.pagerSize instead.", "v0.128.0", logger.Logger())
405-
c.Pagination.PagerSize = c.Paginate
406-
}
407-
if c.PaginatePath != "" {
408-
hugo.DeprecateWithLogger("site config key paginatePath", "Use pagination.path instead.", "v0.128.0", logger.Logger())
409-
c.Pagination.Path = c.PaginatePath
410-
}
411-
412402
// Legacy privacy values.
413403
if c.Privacy.Twitter.Disable {
414404
hugo.DeprecateWithLogger("site config key privacy.twitter.disable", "Use privacy.x.disable instead.", "v0.141.0", logger.Logger())
@@ -687,14 +677,6 @@ type RootConfig struct {
687677
// Enable if the site content has CJK language (Chinese, Japanese, or Korean). This affects how Hugo counts words.
688678
HasCJKLanguage bool
689679

690-
// The default number of pages per page when paginating.
691-
// Deprecated: Use the Pagination struct.
692-
Paginate int
693-
694-
// The path to use when creating pagination URLs, e.g. "page" in /page/2/.
695-
// Deprecated: Use the Pagination struct.
696-
PaginatePath string
697-
698680
// Whether to pluralize default list titles.
699681
// Note that this currently only works for English, but you can provide your own title in the content file's front matter.
700682
PluralizeListTitles bool

hugolib/page__position.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"context"
1818

1919
"github.com/gohugoio/hugo/common/hsync"
20-
"github.com/gohugoio/hugo/common/hugo"
2120
"github.com/gohugoio/hugo/resources/page"
2221
)
2322

@@ -53,22 +52,10 @@ func (p pagePosition) Next() page.Page {
5352
return p.next()
5453
}
5554

56-
// Deprecated: Use Next instead.
57-
func (p pagePosition) NextPage() page.Page {
58-
hugo.Deprecate(".Page.NextPage", "Use .Page.Next instead.", "v0.123.0")
59-
return p.Next()
60-
}
61-
6255
func (p pagePosition) Prev() page.Page {
6356
return p.prev()
6457
}
6558

66-
// Deprecated: Use Prev instead.
67-
func (p pagePosition) PrevPage() page.Page {
68-
hugo.Deprecate(".Page.PrevPage", "Use .Page.Prev instead.", "v0.123.0")
69-
return p.Prev()
70-
}
71-
7259
type pagePositionInSection struct {
7360
*nextPrev
7461
}

hugolib/site.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -663,13 +663,6 @@ func (s *Site) BaseURL() string {
663663
return s.conf.C.BaseURL.WithPath
664664
}
665665

666-
// Deprecated: Use .Site.Lastmod instead.
667-
func (s *Site) LastChange() time.Time {
668-
s.CheckReady()
669-
hugo.Deprecate(".Site.LastChange", "Use .Site.Lastmod instead.", "v0.123.0")
670-
return s.lastmod
671-
}
672-
673666
// Returns the last modification date of the content.
674667
func (s *Site) Lastmod() time.Time {
675668
return s.lastmod
@@ -680,26 +673,6 @@ func (s *Site) Params() hmaps.Params {
680673
return s.conf.Params
681674
}
682675

683-
// Deprecated: Use taxonomies instead.
684-
func (s *Site) Author() map[string]any {
685-
if len(s.conf.Author) != 0 {
686-
hugo.Deprecate(".Site.Author", "Implement taxonomy 'author' or use .Site.Params.Author instead.", "v0.124.0")
687-
}
688-
return s.conf.Author
689-
}
690-
691-
// Deprecated: Use taxonomies instead.
692-
func (s *Site) Authors() page.AuthorList {
693-
hugo.Deprecate(".Site.Authors", "Implement taxonomy 'authors' or use .Site.Params.Author instead.", "v0.124.0")
694-
return page.AuthorList{}
695-
}
696-
697-
// Deprecated: Use .Site.Params instead.
698-
func (s *Site) Social() map[string]string {
699-
hugo.Deprecate(".Site.Social", "Implement taxonomy 'social' or use .Site.Params.Social instead.", "v0.124.0")
700-
return s.conf.Social
701-
}
702-
703676
func (s *Site) Param(key any) (any, error) {
704677
return resource.Param(s, nil, key)
705678
}
@@ -713,12 +686,6 @@ func (s *Site) BuildDrafts() bool {
713686
return s.conf.BuildDrafts
714687
}
715688

716-
// Deprecated: Use hugo.IsMultilingual instead.
717-
func (s *Site) IsMultiLingual() bool {
718-
hugo.Deprecate(".Site.IsMultiLingual", "Use hugo.IsMultilingual instead.", "v0.124.0")
719-
return s.h.isMultilingual()
720-
}
721-
722689
func (s *Site) LanguagePrefix() string {
723690
prefix := s.GetLanguagePrefix()
724691
if prefix == "" {

resources/page/page.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,6 @@ type Positioner interface {
410410
Next() Page
411411
// Prev points down to the previous regular page (sorted by Hugo’s default sort).
412412
Prev() Page
413-
414-
// Deprecated: Use Prev. Will be removed in Hugo 0.57
415-
PrevPage() Page
416-
417-
// Deprecated: Use Next. Will be removed in Hugo 0.57
418-
NextPage() Page
419413
}
420414

421415
// RawContentProvider provides the raw, unprocessed content of the page.

resources/page/page_nop.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,6 @@ func (p *nopPage) NextInSection() Page {
372372
return nil
373373
}
374374

375-
func (p *nopPage) PrevPage() Page {
376-
return nil
377-
}
378-
379-
func (p *nopPage) NextPage() Page {
380-
return nil
381-
}
382-
383375
func (p *nopPage) RawContent() string {
384376
return ""
385377
}

0 commit comments

Comments
 (0)