From 7f4796e3975a98bb77e769fb9f6ccd75cb6de010 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Mon, 17 Feb 2025 01:38:08 -0800 Subject: [PATCH] config/allconfig: Deprecate :filename and :slugorfilename tokens --- config/allconfig/allconfig.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go index 3021028fdfd..af841fb5458 100644 --- a/config/allconfig/allconfig.go +++ b/config/allconfig/allconfig.go @@ -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,