Skip to content

Commit

Permalink
docs, output: Add base template lookup variant to docs.json
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jan 23, 2020
1 parent 4f466db commit cafb1d5
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
92 changes: 92 additions & 0 deletions docs/data/docs.json
Expand Up @@ -1921,6 +1921,22 @@
"layouts/_default/single.html"
]
},
{
"Example": "Base template for single page in \"posts\" section",
"Kind": "page",
"OutputFormat": "HTML",
"Suffix": "html",
"Template Lookup Order": [
"layouts/posts/single-baseof.html.html",
"layouts/posts/baseof.html.html",
"layouts/posts/single-baseof.html",
"layouts/posts/baseof.html",
"layouts/_default/single-baseof.html.html",
"layouts/_default/baseof.html.html",
"layouts/_default/single-baseof.html",
"layouts/_default/baseof.html"
]
},
{
"Example": "Single page in \"posts\" section with layout set",
"Kind": "page",
Expand All @@ -1937,6 +1953,26 @@
"layouts/_default/single.html"
]
},
{
"Example": "Base template for single page in \"posts\" section with layout set",
"Kind": "page",
"OutputFormat": "HTML",
"Suffix": "html",
"Template Lookup Order": [
"layouts/posts/demolayout-baseof.html.html",
"layouts/posts/single-baseof.html.html",
"layouts/posts/baseof.html.html",
"layouts/posts/demolayout-baseof.html",
"layouts/posts/single-baseof.html",
"layouts/posts/baseof.html",
"layouts/_default/demolayout-baseof.html.html",
"layouts/_default/single-baseof.html.html",
"layouts/_default/baseof.html.html",
"layouts/_default/demolayout-baseof.html",
"layouts/_default/single-baseof.html",
"layouts/_default/baseof.html"
]
},
{
"Example": "AMP single page",
"Kind": "page",
Expand Down Expand Up @@ -1985,6 +2021,30 @@
"layouts/_default/list.html"
]
},
{
"Example": "Base template for home page",
"Kind": "home",
"OutputFormat": "HTML",
"Suffix": "html",
"Template Lookup Order": [
"layouts/index-baseof.html.html",
"layouts/home-baseof.html.html",
"layouts/list-baseof.html.html",
"layouts/baseof.html.html",
"layouts/index-baseof.html",
"layouts/home-baseof.html",
"layouts/list-baseof.html",
"layouts/baseof.html",
"layouts/_default/index-baseof.html.html",
"layouts/_default/home-baseof.html.html",
"layouts/_default/list-baseof.html.html",
"layouts/_default/baseof.html.html",
"layouts/_default/index-baseof.html",
"layouts/_default/home-baseof.html",
"layouts/_default/list-baseof.html",
"layouts/_default/baseof.html"
]
},
{
"Example": "Home page with type set",
"Kind": "home",
Expand All @@ -2011,6 +2071,38 @@
"layouts/_default/list.html"
]
},
{
"Example": "Base template for home page with type set",
"Kind": "home",
"OutputFormat": "HTML",
"Suffix": "html",
"Template Lookup Order": [
"layouts/demotype/index-baseof.html.html",
"layouts/demotype/home-baseof.html.html",
"layouts/demotype/list-baseof.html.html",
"layouts/demotype/baseof.html.html",
"layouts/demotype/index-baseof.html",
"layouts/demotype/home-baseof.html",
"layouts/demotype/list-baseof.html",
"layouts/demotype/baseof.html",
"layouts/index-baseof.html.html",
"layouts/home-baseof.html.html",
"layouts/list-baseof.html.html",
"layouts/baseof.html.html",
"layouts/index-baseof.html",
"layouts/home-baseof.html",
"layouts/list-baseof.html",
"layouts/baseof.html",
"layouts/_default/index-baseof.html.html",
"layouts/_default/home-baseof.html.html",
"layouts/_default/list-baseof.html.html",
"layouts/_default/baseof.html.html",
"layouts/_default/index-baseof.html",
"layouts/_default/home-baseof.html",
"layouts/_default/list-baseof.html",
"layouts/_default/baseof.html"
]
},
{
"Example": "Home page with layout set",
"Kind": "home",
Expand Down
4 changes: 4 additions & 0 deletions output/docshelper.go
Expand Up @@ -44,12 +44,16 @@ func createLayoutExamples() interface{} {
}{
// Taxonomy output.LayoutDescriptor={categories category taxonomy en false Type Section
{"Single page in \"posts\" section", LayoutDescriptor{Kind: "page", Type: "posts"}, HTMLFormat},
{"Base template for single page in \"posts\" section", LayoutDescriptor{Baseof: true, Kind: "page", Type: "posts"}, HTMLFormat},
{"Single page in \"posts\" section with layout set", LayoutDescriptor{Kind: "page", Type: "posts", Layout: demoLayout}, HTMLFormat},
{"Base template for single page in \"posts\" section with layout set", LayoutDescriptor{Baseof: true, Kind: "page", Type: "posts", Layout: demoLayout}, HTMLFormat},
{"AMP single page", LayoutDescriptor{Kind: "page", Type: "posts"}, AMPFormat},
{"AMP single page, French language", LayoutDescriptor{Kind: "page", Type: "posts", Lang: "fr"}, AMPFormat},
// All section or typeless pages gets "page" as type
{"Home page", LayoutDescriptor{Kind: "home", Type: "page"}, HTMLFormat},
{"Base template for home page", LayoutDescriptor{Baseof: true, Kind: "home", Type: "page"}, HTMLFormat},
{"Home page with type set", LayoutDescriptor{Kind: "home", Type: demoType}, HTMLFormat},
{"Base template for home page with type set", LayoutDescriptor{Baseof: true, Kind: "home", Type: demoType}, HTMLFormat},
{"Home page with layout set", LayoutDescriptor{Kind: "home", Type: "page", Layout: demoLayout}, HTMLFormat},
{`AMP home, French language"`, LayoutDescriptor{Kind: "home", Type: "page", Lang: "fr"}, AMPFormat},
{"JSON home", LayoutDescriptor{Kind: "home", Type: "page"}, JSONFormat},
Expand Down

0 comments on commit cafb1d5

Please sign in to comment.