]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
config/allconfig: Deprecate :filename and :slugorfilename tokens
authorJoe Mooring <joe.mooring@veriphor.com>
Mon, 17 Feb 2025 09:38:08 +0000 (01:38 -0800)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 17 Feb 2025 11:06:32 +0000 (12:06 +0100)
config/allconfig/allconfig.go

index 3021028fdfd878ca1ce7e9ffb6bdb1aa340b5e29..af841fb54588bd269cfb8b7e7443121b54010fb3 100644 (file)
@@ -427,6 +427,15 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
                c.Services.X.DisableInlineCSS = c.Services.Twitter.DisableInlineCSS
        }
 
+       // Legacy permalink tokens
+       vs := fmt.Sprintf("%v", c.Permalinks)
+       if strings.Contains(vs, ":filename") {
+               hugo.Deprecate("the \":filename\" permalink token", "Use \":contentbasename\" instead.", "0.144.0")
+       }
+       if strings.Contains(vs, ":slugorfilename") {
+               hugo.Deprecate("the \":slugorfilename\" permalink token", "Use \":slugorcontentbasename\" instead.", "0.144.0")
+       }
+
        c.C = &ConfigCompiled{
                Timeout:             timeout,
                BaseURL:             baseURL,