mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 10:44:44 -04:00
Move lookup order section within lookup order page
See PR rdwatters/hugo-docs-concept#99 Fixes rdwatters/hugo-docs-concept#98
This commit is contained in:
parent
8fb94fa4ae
commit
9c72fa3661
@ -31,6 +31,34 @@ The power of the lookup order is that it enables you to craft specific layouts a
|
||||
Most Hugo websites will only need the default template files at the end of the lookup order (i.e. `_default/*.html`).
|
||||
{{% /note %}}
|
||||
|
||||
## Lookup Orders
|
||||
|
||||
The respective lookup order for each of Hugo's templates has been defined throughout the Hugo docs:
|
||||
|
||||
* [Homepage Template][home]
|
||||
* [Base Templates][base]
|
||||
* [Section Page Templates][sectionlookup]
|
||||
* [Taxonomy List Templates][taxonomylookup]
|
||||
* [Taxonomy Terms Templates][termslookup]
|
||||
* [Single Page Templates][singlelookup]
|
||||
* [RSS Templates][rsslookup]
|
||||
* [Shortcode Templates][sclookup]
|
||||
|
||||
[base]: /templates/base/#base-template-lookup-order
|
||||
[config]: /getting-started/configuration/
|
||||
[directory structure]: /getting-started/directory-structure/
|
||||
[DRY]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
|
||||
[home]: /templates/homepage/#homepage-template-lookup-order
|
||||
[rsslookup]: /templates/rss/#rss-template-lookup-order
|
||||
[sclookup]: /templates/shortcode-templates/#shortcode-template-lookup-order
|
||||
[sections]: /content-management/sections/
|
||||
[sectionlookup]: /templates/section-templates/#section-template-lookup-order
|
||||
[single page templates]: /templates/single-page-templates/
|
||||
[singlelookup]: /templates/single-page-templates/#single-page-template-lookup-order
|
||||
[switch]: https://en.wikipedia.org/wiki/Switch_statement#Fallthrough
|
||||
[taxonomylookup]: /templates/taxonomy-templates/#taxonomy-list-template-lookup-order
|
||||
[termslookup]: /templates/taxonomy-templates/#taxonomy-terms-template-lookup-order
|
||||
|
||||
## Template Lookup Examples
|
||||
|
||||
The lookup order is best illustrated through examples. The following shows you the process Hugo uses for finding the appropriate template to render your [single page templates][], but the concept holds true for all templates in Hugo.
|
||||
@ -166,31 +194,3 @@ Here is the way Hugo traverses the single-page lookup order for `my-first-event.
|
||||
{{% note %}}
|
||||
`my-first-event.md` is significant because it demonstrates the role of the lookup order in Hugo themes. Both the root project directory *and* the `mytheme` themes directory have a file at `_default/single.html`. Understanding this order allows you to [customize Hugo themes](/themes/customizing/) by creating template files with identical names in your project directory that step in front of theme template files in the lookup. This allows you to customize the look and feel of your website while maintaining compatibility with the theme's upstream.
|
||||
{{% /note %}}
|
||||
|
||||
## Lookup Orders
|
||||
|
||||
The respective lookup order for each of Hugo's templates has been defined throughout the Hugo docs:
|
||||
|
||||
* [Homepage Template][home]
|
||||
* [Base Templates][base]
|
||||
* [Section Page Templates][sectionlookup]
|
||||
* [Taxonomy List Templates][taxonomylookup]
|
||||
* [Taxonomy Terms Templates][termslookup]
|
||||
* [Single Page Templates][singlelookup]
|
||||
* [RSS Templates][rsslookup]
|
||||
* [Shortcode Templates][sclookup]
|
||||
|
||||
[base]: /templates/base/#base-template-lookup-order
|
||||
[config]: /getting-started/configuration/
|
||||
[directory structure]: /getting-started/directory-structure/
|
||||
[DRY]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
|
||||
[home]: /templates/homepage/#homepage-template-lookup-order
|
||||
[rsslookup]: /templates/rss/#rss-template-lookup-order
|
||||
[sclookup]: /templates/shortcode-templates/#shortcode-template-lookup-order
|
||||
[sections]: /content-management/sections/
|
||||
[sectionlookup]: /templates/section-templates/#section-template-lookup-order
|
||||
[single page templates]: /templates/single-page-templates/
|
||||
[singlelookup]: /templates/single-page-templates/#single-page-template-lookup-order
|
||||
[switch]: https://en.wikipedia.org/wiki/Switch_statement#Fallthrough
|
||||
[taxonomylookup]: /templates/taxonomy-templates/#taxonomy-list-template-lookup-order
|
||||
[termslookup]: /templates/taxonomy-templates/#taxonomy-terms-template-lookup-order
|
Loading…
x
Reference in New Issue
Block a user