From 9c72fa36610ae7c58ac821ec75c9b61f2d8c4f96 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Fri, 21 Apr 2017 16:02:05 -0500 Subject: [PATCH] Move lookup order section within lookup order page See PR rdwatters/hugo-docs-concept#99 Fixes rdwatters/hugo-docs-concept#98 --- content/templates/lookup-order.md | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/content/templates/lookup-order.md b/content/templates/lookup-order.md index bc4ff80bc..9d43938a1 100644 --- a/content/templates/lookup-order.md +++ b/content/templates/lookup-order.md @@ -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 \ No newline at end of file