From 8b0214e9a5202656307fd55f0c39a01fb6b8e2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 28 Oct 2023 00:36:30 +0200 Subject: [PATCH] theme: write full file path on warnings #699 --- exampleSite/layouts/partials/shortcodes/piratify.html | 2 +- layouts/partials/archetypes/deprecated-chapter/article.html | 2 +- layouts/partials/archetypes/deprecated-home/article.html | 2 +- layouts/partials/authorname.hugo | 2 +- layouts/partials/menu.html | 2 +- layouts/partials/pageHelper/pagesBy.html | 2 +- layouts/partials/shortcodes/attachments.html | 6 +++--- layouts/partials/shortcodes/badge.html | 2 +- layouts/partials/shortcodes/button.html | 2 +- layouts/partials/shortcodes/children.html | 2 +- layouts/partials/shortcodes/expand.html | 2 +- layouts/partials/shortcodes/highlight.html | 2 +- layouts/partials/shortcodes/icon.html | 2 +- layouts/partials/shortcodes/image.html | 4 ++-- layouts/partials/shortcodes/include.html | 2 +- layouts/partials/shortcodes/link.html | 6 +++--- layouts/partials/shortcodes/math.html | 2 +- layouts/partials/shortcodes/mermaid.html | 2 +- layouts/partials/shortcodes/notice.html | 2 +- layouts/partials/shortcodes/openapi.html | 2 +- layouts/partials/shortcodes/siteparam.html | 2 +- layouts/partials/shortcodes/swagger.html | 4 ++-- layouts/partials/shortcodes/tab.html | 2 +- layouts/partials/shortcodes/tabs.html | 4 ++-- layouts/partials/stylesheet.html | 2 +- layouts/shortcodes/button.html | 2 +- layouts/shortcodes/include.html | 2 +- layouts/shortcodes/tabs.html | 2 +- 28 files changed, 35 insertions(+), 35 deletions(-) diff --git a/exampleSite/layouts/partials/shortcodes/piratify.html b/exampleSite/layouts/partials/shortcodes/piratify.html index 90c314e302..acb66b5c1d 100644 --- a/exampleSite/layouts/partials/shortcodes/piratify.html +++ b/exampleSite/layouts/partials/shortcodes/piratify.html @@ -1,7 +1,7 @@ {{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} - {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }} + {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Filename }} {{- end }} {{- $content := .content }} {{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }} diff --git a/layouts/partials/archetypes/deprecated-chapter/article.html b/layouts/partials/archetypes/deprecated-chapter/article.html index 6fc5d911e7..624d847881 100644 --- a/layouts/partials/archetypes/deprecated-chapter/article.html +++ b/layouts/partials/archetypes/deprecated-chapter/article.html @@ -1,7 +1,7 @@ {{- $page := .page }} {{- $content := .content }} {{- with $page }} - {{- warnf "%q: DEPRECATED usage of old 'chapter' archetype found, remove 'chapter=true' and add 'archetype=\"chapter\"' to your frontmatter and remove the leading h3 and h1 headings; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#500" $page.File.Path }} + {{- warnf "%q: DEPRECATED usage of old 'chapter' archetype found, remove 'chapter=true' and add 'archetype=\"chapter\"' to your frontmatter and remove the leading h3 and h1 headings; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#500" $page.File.Filename }}
{{- partial "content-header.html" . }} diff --git a/layouts/partials/archetypes/deprecated-home/article.html b/layouts/partials/archetypes/deprecated-home/article.html index 8dd26d3c64..fec3821316 100644 --- a/layouts/partials/archetypes/deprecated-home/article.html +++ b/layouts/partials/archetypes/deprecated-home/article.html @@ -1,7 +1,7 @@ {{- $page := .page }} {{- $content := .content }} {{- with $page }} - {{- warnf "%q: DEPRECATED usage of old 'home' archetype found, add 'archetype=\"home\"' to your frontmatter and remove the leading h1 heading; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#500" $page.File.Path }} + {{- warnf "%q: DEPRECATED usage of old 'home' archetype found, add 'archetype=\"home\"' to your frontmatter and remove the leading h1 heading; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#500" $page.File.Filename }}
{{- partial "content-header.html" . }} diff --git a/layouts/partials/authorname.hugo b/layouts/partials/authorname.hugo index c5252e2bf9..e3f5a28915 100644 --- a/layouts/partials/authorname.hugo +++ b/layouts/partials/authorname.hugo @@ -5,7 +5,7 @@ {{- $authorName = . }} {{- end }} {{- else }} - {{- warnf "%q: DEPRECATED usage of 'params.author' config parameter found, replace it with `params.author.name` in your config.toml; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5230" .File.Path }} + {{- warnf "%q: DEPRECATED usage of 'params.author' config parameter found, replace it with `params.author.name` in your config.toml; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5230" .File.Filename }} {{- $authorName = .Site.Params.author }} {{- end }} {{- else }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 7a3e792684..e8276bbd04 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -20,7 +20,7 @@