Make more copy edits to customizing themes tutorial

This commit is contained in:
Ryan Watters
2017-02-23 17:26:20 -06:00
parent 4c101c5e72
commit d8c64b2d20
22 changed files with 529 additions and 650 deletions
+1
View File
@@ -51,6 +51,7 @@ This is no longer a site navigation link and is instead a button along with "Fil
* "Tutorials" is not an intuitive place for end-users to look for this kind of documentation
* All content moved from `/tutorials` edited to reflect a less tutorial-ish style of language (e.g., remove of lines starting with "In this tutorial...")
* Aliases added to new pages and in-page links updated throughout
* Michael Henderson's "Creating a Theme" website ([current][],[concept][]) has been copy edited and content edited to include the new code block shortcodes.
### Troubleshooting
+2 -4
View File
@@ -1,5 +1,5 @@
---
title: The Benefits of Static
title: The Benefits of Static Site Generators
linktitle: The Benefits of Static
description: Learn why static site generators have become such a popular option for developers. Benefits include performance, security, ease of use, and exportability of content.
date: 2017-02-01
@@ -20,9 +20,7 @@ To prevent unnecessary delays in delivering pages to end users, dynamic site gen
Hugo and other static site generators take caching a step further. All HTML files are rendered on your computer. You can review the files before you copy them to the computer hosting the HTTP server. Since the HTML files aren't generated dynamically, we say that Hugo is a "static site generator."
Not running a website generator on your HTTP server has many benefits. The most noticeable is performance---HTTP servers are very good at
sending files. So good that you can effectively serve the same number
of pages with a fraction of the memory and CPU needed for a dynamic site.
Not running a website generator on your HTTP server has many benefits. The most noticeable is performance---HTTP servers are very good at sending files. So good that you can effectively serve the same number of pages with a fraction of the memory and CPU needed for a dynamic site.
## Resources on Static Site Generators
+8 -7
View File
@@ -18,26 +18,27 @@ In no particular order, here is what is currently being worked on for the Hugo p
* Intelligently related posts ({{< gh 98 >}})
* Even easier deployment to S3, SSH, GitHub, rsync. Give the [hosting and deployment][] section a shot.
* Import from other website systems. There are already [existing migration tools][], but they dont cover all major platforms.
* Import from other website systems. There are already [existing migration tools][migrate], but they dont cover all major platforms.
* An interactive web-based editor (See the [related Discuss thread][])
* Additional [themes][], which are always ongoing and contributions are welcome!
* Dynamic image resizing via shortcodes ({{< gh 1014 >}})
* Native support for additional content formats (AsciiDoc {{< gh 1435>}}, reST {{< gh 1436 >}})
* And, last but not least, [*your* best ideas!][]
* And, last but not least, [***your*** best ideas!][]
## Contributions Welcome
Feel free to [contribute][] or [open a new issue][] if you have an idea for a new feature.
Feel free to [contribute to Hugo's development][devcontribute], [improve Hugo's documentation][doccontribute], or [open a new issue][newissue] if you have an idea for a new feature.
[#98]: https://github.com/spf13/hugo/issues/98
[#1014]: https://github.com/spf13/hugo/issues/1014
[#1435]: https://github.com/spf13/hugo/issues/1435
[#1436]: https://github.com/spf13/hugo/issues/1436
[contribute]: /contribute-to-hugo/
[devcontribute]: /contribute-to-hugo/contribute-to-hugo-development/
[doccontribute]: /contribute-to-hugo/contribute-to-the-hugo-docs/
[hosting and deployment]: /hosting-and-deployment/
[existing migration tools]: /developer-tools/migrate-to-hugo/
[open a new issue]: https://github.com/spf13/hugo/issues/
[migrate]: /developer-tools/migrate-to-hugo/
[newissue]: https://github.com/spf13/hugo/issues/
[related Discuss thread]: https://discuss.gohugo.io/t/web-based-editor/155
[themes]: /themes/
[tutorials]: /tutorials
[*your* best ideas!]: /contribute-to-hugo/
[***your*** best ideas!]: /contribute-to-hugo/
+26 -15
View File
@@ -53,12 +53,6 @@ The following is a list of values that can be used in a `permalink` definition i
* `:slug` = the content's slug (or title if no slug)
* `:filename` = the content's filename (without extension)
## Aliases
For people migrating existing published content to Hugo, there's a good chance you need a mechanism to handle redirecting old URLs.
Luckily, redirects can be handled easily with _aliases_ in Hugo.
## Example
Given a post on your current Hugo site, with a path of:
@@ -116,7 +110,13 @@ aliases:
---
```
## How Hugo Aliases Work
## Aliases
For people migrating existing published content to Hugo, there's a good chance you need a mechanism to handle redirecting old URLs.
Luckily, redirects can be handled easily with _aliases_ in Hugo.
### How Hugo Aliases Work
When aliases are specified, Hugo creates a physical folder structure to match the alias entry, and, an html file specifying the canonical URL for the page, and a redirect target.
@@ -136,20 +136,31 @@ Assuming a baseURL of `mysite.tld`, the contents of the html file will look some
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case.
## Customizing
### Customizing
You may customize this alias page by creating an alias.html template in the
layouts folder of your site. In this case, the data passed to the template is
layouts folder of your site. In this case, the data passed to the template is
* Permalink - the link to the page being aliased
* Page - the Page data for the page being aliased
`Permalink`
: the link to the page being aliased
`Page`
: the Page data for the page being aliased
## Pretty URLs
By default, Hugo renders your content with "pretty" URLs. For example,
content created at `/content/extras/urls.md` will be rendered at
`/public/extras/urls/index.html` according to Hugo's default behavior after running the `hugo` CLI build command. No non-standard server-side
configuration is required for these pretty URLs to work.
Hugo's default behavior is to render your content with "pretty" URLs. No non-standard server-side configuration is required for these pretty URLs to work.
The following demonstrates the concept:
```bash
content/posts/_index.md
=> yoursite.com/posts/index.html
content/posts/post-1.md
=> yoursite.com/
content/posts/post-2.md
content/posts/post-3.md
```
## Ugly URLs
@@ -146,7 +146,11 @@ This is a warning, which should be reserved for *important* information like bre
It's more important to contribute *some* documentation than no documentation at all. We need your help!
{{% /note %}}
The Hugo docs are not especially prescriptive in terms of grammar and usage. We encourage everyone to contribute, regardless of your writing style. That said, here are a few pointers to help the project maintain more consistency:
The Hugo docs are not especially prescriptive in terms of grammar and usage. We encourage everyone to contribute, regardless of your writing style. That said, here are a few gotchas when writing your documentation that, if observed, will create a more consistent documentation experience:
1. *Front matter* is two words.
2. *Homepage* is one word.
3. Be sure to add a `godocref` whenever possible to a new content file's front matter. We want to promote Hugo *and* Golang by demonstrating the inseparable wedding of the two.
## How Content is Ordered in the Docs
@@ -154,7 +158,7 @@ The Hugo docs are not especially prescriptive in terms of grammar and usage. We
## Be Mindful of Aliases
Use aliases sparingly. The following table shows a list of all the aliases used in the Hugo Docs. If you need to use an alias in your new content file's front matter, be sure to check here first.
Use aliases sparingly. The following table shows a list of all the aliases used in the Hugo Docs. If you need to use an alias in your new content file's front matter, be sure to check here first to prevent conflicts.
{{< allaliases >}}
@@ -105,7 +105,7 @@ The keywords in the `highlight` shortcode mirror those of Pygments from the comm
It is also possible to add syntax highlighting with GitHub flavored code fences. To enable this, set the `PygmentsCodeFences` to `true` in Hugo's [configuration file](/getting-started/configuration/);
````
``` html
```html
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
+18
View File
@@ -0,0 +1,18 @@
---
title: truncate
linktitle: truncate
description:
godocref:
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [functions]
tags: []
toc: false
draft: false
aliases: []
---
Truncate a text to a max length without cutting words or leaving unclosed HTML tags. Since Go templates are HTML-aware, truncate will handle normal strings vs HTML strings intelligently. It's important to note that if you have a raw string that contains HTML tags that you want treated as HTML, you will need to convert the string to HTML using the safeHTML template function before sending the value to truncate; otherwise, the HTML tags will be escaped by truncate.
`{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}``<em>Keep my …</em>`
+7 -1
View File
@@ -135,6 +135,8 @@ pygmentsCodeFencesGuessSyntax: false
pygmentsStyle: "monokai"
# true use pygments-css or false will color code directly
pygmentsUseClasses: false
# maximum number of items in the RSS feed
rssLimit: 15
# see "Section Menu for Lazy Bloggers", /templates/menu-templates for more info
SectionPagesMenu: ""
# default sitemap configuration map
@@ -247,7 +249,9 @@ layoutDir = "layouts"
# Enable Logging
log = false
# Log File path (if set, logging enabled automatically)
logFile = ""
logFile =
# maximum number of items in the RSS feed
rssLimit = 15
# "toml","yaml", or "json"
metaDataFormat = "toml"
newContentEditor = ""
@@ -272,6 +276,8 @@ pygmentsCodeFencesGuessSyntax = false
pygmentsStyle = "monokai"
# true: use pygments-css or false: color-codes directly
pygmentsUseClasses = false
# maximum number of items in the RSS feed
rssLimit: 15
# see "Section Menu for Lazy Bloggers", /templates/menu-templates for more info
SectionPagesMenu =
# default sitemap configuration map
+1
View File
@@ -49,6 +49,7 @@ You can check your `hugo version` as well:
```bash
hugo version
```
```
Hugo Static Site Generator v0.18.1 BuildDate: 2016-12-30T05:02:43-05:00
```
+1
View File
@@ -12,3 +12,4 @@ tags:
image: arresteddevops.png
title: arresteddevops
---
+3 -9
View File
@@ -28,21 +28,15 @@ Hugo uses the term *list* in its truest sense: a sequential arrangement of mater
Since section lists and taxonomy lists (N.B., *not* [taxonomy terms lists][]) are both *lists* with regards to their templates, both of these templates have the same terminating default of `_default/list.html`---or `themes/mytheme/layouts/_default/list.html` in the case of a themed project---in their *lookup orders*. In addition, both [section lists][sections] and [taxonomy lists][taxonomies] have their own default list templates in `_default`:
#### Default Section Templates
1. `layouts/section/sectionname.html`
### Understanding `.Data.Pages`
{{% note "The Confusion over `.Data`" %}}
**Mention something here about the difference between .Data.Pages and .Site.Data maybe?**
{{% /note %}}
[homepage]: /templates/homepage-template/
+97 -79
View File
@@ -18,8 +18,6 @@ needsreview: true
{{< lookupexplanation >}}
## Lookup Order for Section Page Templates
Hugo uses a set of rules to figure out which template to use when rendering a specific page.
@@ -232,19 +230,23 @@ The below example sorts a list of posts by their rating.
If the frontmatter field of interest is nested beneath another field, you can
also get it:
{{ range (.Date.Pages.ByParam "author.last_name") }}
<!-- ... -->
{{ end }}
```
{{ range (.Date.Pages.ByParam "author.last_name") }}
<!-- ... -->
{{ end }}
```
### Reverse Order
Can be applied to any of the above. Using Date for an example.
{{ range .Data.Pages.ByDate.Reverse }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
```
{{ range .Data.Pages.ByDate.Reverse }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
```
## Grouping Content
@@ -256,73 +258,83 @@ your list templates:
### Grouping by Page field
{{ range .Data.Pages.GroupBy "Section" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
```
{{ range .Data.Pages.GroupBy "Section" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
```
### Grouping by Page date
{{ range .Data.Pages.GroupByDate "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
```
{{ range .Data.Pages.GroupByDate "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
```
### Grouping by Page publish date
{{ range .Data.Pages.GroupByPublishDate "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .PublishDate.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
```
{{ range .Data.Pages.GroupByPublishDate "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .PublishDate.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
```
### Grouping by Page param
{{ range .Data.Pages.GroupByParam "param_key" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
```html
{{ range .Data.Pages.GroupByParam "param_key" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
```
### Grouping by Page param in date format
{{ range .Data.Pages.GroupByParamDate "param_key" "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
```html
{{ range .Data.Pages.GroupByParamDate "param_key" "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
```
### Reversing Key Order
@@ -335,20 +347,24 @@ its really just a matter of preference.
#### Reverse method
{{ range (.Data.Pages.GroupBy "Section").Reverse }}
...
```golang
{{ range (.Data.Pages.GroupBy "Section").Reverse }}
```
{{ range (.Data.Pages.GroupByDate "2006-01").Reverse }}
...
```golang
{{ range (.Data.Pages.GroupByDate "2006-01").Reverse }}
```
#### Providing the (alternate) direction
{{ range .Data.Pages.GroupByDate "2006-01" "asc" }}
...
```golang
{{ range .Data.Pages.GroupByDate "2006-01" "asc" }}
```
{{ range .Data.Pages.GroupBy "Section" "desc" }}
...
```golang
{{ range .Data.Pages.GroupBy "Section" "desc" }}
```
### Ordering Pages within Group
@@ -357,17 +373,19 @@ Because Grouping returns a key and a slice of pages, all of the ordering methods
In this example, Ive ordered the groups in chronological order and the content
within each group in alphabetical order by title.
{{ range .Data.Pages.GroupByDate "2006-01" "asc" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages.ByTitle }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
```html
{{ range .Data.Pages.GroupByDate "2006-01" "asc" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages.ByTitle }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
```
## Filtering & Limiting Content
+39 -20
View File
@@ -10,27 +10,41 @@ tags: [themes, source, organization, directories]
weight: 20
draft: false
aliases: [/themes/customizing/,/themes/customize/]
toc: false
toc: true
needsreview: true
---
_The following are key concepts for Hugo site customization. Hugo permits you to **supplement or override** any theme template or static file, with files in your working directory._
## Introduction
_When you use a theme cloned from its git repository, you do not edit the theme's files directly. Rather, you override them as per the following:_
The following are key concepts for Hugo site customization. Hugo permits you to supplement *or* override any theme template or static file, with files in your working directory.
## Replace Static Files
{{% note %}}
When you use a theme cloned from its git repository, do not edit the theme's files directly. Instead, theme customization in Hugo is a matter of *overriding* the templates made available to you in a theme. This provides the added flexibility of tweaking a theme to meet your needs while staying current with a theme's upstream.
{{% /note %}}
For including a different file than what the theme ships with. For example, if you would like to use a more recent version of jQuery than what the theme happens to include, simply place an identically-named file in the same relative location but in your working directory.
## Understanding the Theme Lookup Order
For example, if the theme has jQuery 1.6 in:
{{< lookupexplanation >}}
/themes/themename/static/js/jquery.min.js
## Replacing Static Files
... you would simply place your file in the same relative path, but in the root of your working folder:
There are times where you want to include static assets that differ from versions of the same asset that ships with a theme. For example, if you would like to use a more recent version of jQuery than what the theme happens to include, simply place an identically-named file in the same relative location but in your working directory.
/static/js/jquery.min.js
Let's assume the theme you are using has jQuery 1.8 in the following location:
## Replace a single template file
```bash
/themes/mytheme/static/js/jquery.min.js
```
You want to replace jQuery with jQuery 1.7. The easiest way to do this is to replace the file *with a file of the same name* in the same relative path in your project's root.
So, to replace jQuery 1.7 from the theme, take your version of jQuery (e.g., `jquery-3.1.1.js`), change the file name so that it is *identical* to the theme file you are trying to use (`jquery.min.js`) and place it here:
```bash
/static/js/jquery.min.js
```
## Replacing Template Files
Anytime Hugo looks for a matching template, it will first check the working directory before looking in the theme directory. If you would like to modify a template, simply create that template in your local `layouts` directory.
@@ -40,21 +54,26 @@ This is especially helpful when the theme creator used [partial templates](/temp
For example:
/themes/themename/layouts/_default/single.html
```bash
/themes/themename/layouts/_default/single.html
```
... would be overridden by:
Would be overwritten by
/layouts/_default/single.html
```bash
/layouts/_default/single.html
```
**Warning**: This only works for templates that Hugo "knows about" (that follow its convention for folder structure and naming). If the theme imports template files in a creatively-named directory, Hugo wont know to look for the local `/layouts` first.
{{% warning %}}
This only works for templates that Hugo "knows about" (i.e., that follow its convention for folder structure and naming). If a theme imports template files in a creatively named directory, Hugo wont know to look for the local `/layouts` first.
{{% /warning %}}
## Replace an archetype
## Replace an Archetype
If the archetype that ships with the theme for a given content type (or all content types) doesnt fit with how you are using the theme, feel free to copy it to your `/archetypes` directory and make modifications as you see fit.
## Beware of the default
**Default** is a very powerful force in Hugo, especially as it pertains to overwriting theme files. If a default is located in the local archetype directory or `/layouts/_default/` directory, it will be used instead of any of the similar files in the theme.
It is usually better to override specific files rather than using the default in your working directory.
{{% warning "Beware of `layouts/_default`" %}}
The `_default` directory is a very powerful force in Hugo, especially as it pertains to overwriting theme files. If a default file is located in the local [archetype](/content-management/archetypes/) or layout directory (i.e., `archetypes/default.md` or `/layouts/_default/*.html`, respectively), it will override the file of the same name in the corresponding theme directory (i.e., `themes/<mytheme>/archetypes/default.md` or `themes/<mytheme>/layout/_defaults/*.html`, respectively).
It is usually better to override specific files; i.e. rather than using `layouts/_default/*.html` in your working directory.
{{% /warning %}}
@@ -11,6 +11,7 @@ tags: [internationalization,multilingual,i18n,tutorials]
authors: ["Rick Cogley"]
aliases: [/tutorials/create-a-multilingual-site/]
draft: false
hugoversion: 16
needsreview: true
---
File diff suppressed because it is too large Load Diff
@@ -10,6 +10,7 @@ tags: [migrations,jekyll, command line]
authors: [Alexandre Normand]
weight:
draft: false
hugoversion: 14
toc: true
aliases: [/tutorials/migrate-from-jekyll/]
needsreview: true
@@ -12,7 +12,6 @@ weight: 50
aliases: [/extras/gitinfo/,/variables-and-params/other/]
toc: true
needsreview: true
notesforauthors:
---
## Shortcode Variables
@@ -88,31 +87,31 @@ We highly recommend using `.Hugo.Generator` in your website. It is already inclu
A menu entry in a [menu template][] has the following properties:
`URL`
`.URL`
: string
`Name`
`.Name`
: string
`Menu`
`.Menu`
: string
`Identifier`
`.Identifier`
: string
`Pre`
`.Pre`
: template.HTML
`Post`
`.Post`
: template.HTML
`Weight`
`.Weight`
: int
`Parent`
`.Parent`
: string
`Children`
`.Children`
: Menu
@@ -43,7 +43,7 @@ See [`.Scratch`](/functions/scratch/) for page-scoped writable variables.
: the approximate number of words in the content.
`.Hugo`
: see [Hugo Variables](/variables-and-params/shortcode-git-and-hugo-variables/).
: see [Hugo Variables](/variables-and-params/other/).
`.IsHome`
: `true` in the context of the [home page](/templates/homepage-template/).
+12 -1
View File
@@ -1,3 +1,13 @@
{{- if .IsNamedParams -}}
{{$filenameclass := index (split (.Get "filename") ".") 1 }}
<div class="code-copy input" id="{{.Get "filename" | urlize}}">
{{- with .Get "filename" -}}<div class="code-copy-header"><div class="action-buttons"></div><span title="{{.}}" class="filename">{{- . -}}</span><i class="icon-{{$filenameclass}} input"></i></div>{{- end -}}
<button class="copy-button" title="Copy to clipboard" data-clipboard-snippet>
<div class="copy-text"><i class="icon-clipboard"></i> COPY</div>
</button>
{{- .Inner -}}
</div>
{{- else -}}
{{$filenameclass := index (split (.Get 0) ".") 1 }}
<div class="code-copy input" id="{{.Get 0|urlize}}">
<div class="code-copy-header"><div class="action-buttons"></div>{{if ne $filenameclass "sh"}}<span class="filename" title="{{.Get 0}}">{{.Get 0}}</span>{{end}}<i class="icon-{{$filenameclass}} input"></i></div>{{- if ne (index .Params 1) "nocopy" -}}
@@ -6,4 +16,5 @@
</button>
{{- end -}}
{{- .Inner -}}
</div>
</div>
{{end}}
+1 -1
View File
@@ -1 +1 @@
{{partial "lookup-explanation.html" . | markdownify}}
{{partial "lookup-explanation-markdown.html" . | markdownify}}
+1 -1
View File
@@ -4,7 +4,7 @@
<main class="main">
<header class="content-header">
{{partial "breadcrumb.html" . }}
<h1 class="page-title {{.Section}}" id="{{with .LinkTitle}}{{. | urlize}}{{else}}{{ .Title | urlize }}{{end}}">{{with .LinkTitle}}{{.}}{{else}}{{ .Title | markdownify }}{{end}}</h1>
<h1 class="page-title {{.Section}}" id="{{with .LinkTitle}}{{. | urlize}}{{else}}{{ .Title | urlize }}{{end}}">{{ .Title | markdownify }}</h1>
{{partial "content-header-links.html" . }}
{{partial "tags.html" . }}
{{if .Params.needsreview }}
@@ -1,4 +1,4 @@
Hugo uses a prioritized list called the *lookup order* as it traverses your files looking for the appropriate template to render your content. The template lookup order is an inverted cascade: if template A isnt present or specified, Hugo will look to template B. If template B isn't present or specified, Hugo will look for template C, and so on until it reaches the `layouts/_default/`` directory for your project, or in the case of themes, `themes/<yourchosentheme>/layouts/_default/`. In many ways, the lookup order is similar to the [control mechanism of a switch statement (without fallthrough)][switch] seen in many programming languages.
Hugo uses a prioritized list called the *lookup order* as it traverses your files looking for the appropriate template to render your content. The template lookup order is an inverted cascade: if template A isnt present or specified, Hugo will look to template B. If template B isn't present or specified, Hugo will look for template C, and so on until it reaches the `layouts/_default/` directory for your project, or in the case of themes, `themes/<mytheme>/layouts/_default/`. In many ways, the lookup order is similar to the [control mechanism of a switch statement (i.e. without fallthrough)][switch] seen in many programming languages.
The power of the lookup order is that it enables you to craft specific layouts as needed without creating more templating than necessary, thereby keeping your templating [DRY][dry]. *Most sites will only need the default template files at the end of the lookup* (i.e. `_default/*.html`).