Skip to content

Commit

Permalink
output: Fix docshelper template lookup order for AMP pages
Browse files Browse the repository at this point in the history
Fixes #12797
  • Loading branch information
jmooring authored and bep committed Aug 28, 2024
1 parent 371246d commit 1ecd059
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions docs/data/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions output/docshelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}},
Expand Down

0 comments on commit 1ecd059

Please sign in to comment.