aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-08-26 07:27:43 -0700
committerBjørn Erik Pedersen <[email protected]>2024-08-28 13:05:28 +0200
commit1ecd0596a3df62c6ad266e70d7cad51f8e916a08 (patch)
tree1b7b52729ca8fb99cab141c9dddafb69e865c726
parent371246de25c258343ef7688945c7a2d9b471214a (diff)
downloadhugo-1ecd0596a3df62c6ad266e70d7cad51f8e916a08.tar.gz
hugo-1ecd0596a3df62c6ad266e70d7cad51f8e916a08.zip
output: Fix docshelper template lookup order for AMP pages
Fixes #12797
-rw-r--r--docs/data/docs.yaml14
-rw-r--r--output/docshelper.go4
2 files changed, 9 insertions, 9 deletions
diff --git a/docs/data/docs.yaml b/docs/data/docs.yaml
index 7ac76ee39..8d97c21e0 100644
--- a/docs/data/docs.yaml
+++ b/docs/data/docs.yaml
@@ -1865,7 +1865,7 @@ output:
- layouts/_default/demolayout-baseof.html
- layouts/_default/single-baseof.html
- layouts/_default/baseof.html
- - Example: AMP single page
+ - Example: AMP single page in "posts" section
Kind: page
OutputFormat: amp
Suffix: html
@@ -1874,17 +1874,17 @@ output:
- layouts/posts/single.html
- layouts/_default/single.amp.html
- layouts/_default/single.html
- - Example: AMP single page, French language
+ - Example: AMP single page in "posts" section, French language
Kind: page
- OutputFormat: html
+ OutputFormat: amp
Suffix: html
Template Lookup Order:
- - layouts/posts/single.fr.html.html
- - layouts/posts/single.html.html
+ - layouts/posts/single.fr.amp.html
+ - layouts/posts/single.amp.html
- layouts/posts/single.fr.html
- layouts/posts/single.html
- - layouts/_default/single.fr.html.html
- - layouts/_default/single.html.html
+ - layouts/_default/single.fr.amp.html
+ - layouts/_default/single.amp.html
- layouts/_default/single.fr.html
- layouts/_default/single.html
- Example: Home page
diff --git a/output/docshelper.go b/output/docshelper.go
index f7f3b0c4a..0f2a0eff6 100644
--- a/output/docshelper.go
+++ b/output/docshelper.go
@@ -46,8 +46,8 @@ func createLayoutExamples() any {
{"Base template for single page in \"posts\" section", layouts.LayoutDescriptor{Baseof: true, Kind: "page", Type: "posts", OutputFormatName: "html", Suffix: "html"}},
{"Single page in \"posts\" section with layout set to \"demolayout\"", layouts.LayoutDescriptor{Kind: "page", Type: "posts", Layout: demoLayout, OutputFormatName: "html", Suffix: "html"}},
{"Base template for single page in \"posts\" section with layout set to \"demolayout\"", layouts.LayoutDescriptor{Baseof: true, Kind: "page", Type: "posts", Layout: demoLayout, OutputFormatName: "html", Suffix: "html"}},
- {"AMP single page", layouts.LayoutDescriptor{Kind: "page", Type: "posts", OutputFormatName: "amp", Suffix: "html"}},
- {"AMP single page, French language", layouts.LayoutDescriptor{Kind: "page", Type: "posts", Lang: "fr", OutputFormatName: "html", Suffix: "html"}},
+ {"AMP single page in \"posts\" section", layouts.LayoutDescriptor{Kind: "page", Type: "posts", OutputFormatName: "amp", Suffix: "html"}},
+ {"AMP single page in \"posts\" section, French language", layouts.LayoutDescriptor{Kind: "page", Type: "posts", Lang: "fr", OutputFormatName: "amp", Suffix: "html"}},
// Typeless pages get "page" as type
{"Home page", layouts.LayoutDescriptor{Kind: "home", Type: "page", OutputFormatName: "html", Suffix: "html"}},
{"Base template for home page", layouts.LayoutDescriptor{Baseof: true, Kind: "home", Type: "page", OutputFormatName: "html", Suffix: "html"}},