mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-02 22:52:51 +02:00
Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'
This commit is contained in:
@@ -1,19 +1,13 @@
|
||||
---
|
||||
title: Partial Templates
|
||||
linktitle: Partial Templates
|
||||
description: Partials are smaller, context-aware components in your list and page templates that can be used economically to keep your templating DRY.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates]
|
||||
keywords: [lists,sections,partials]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
parent: templates
|
||||
weight: 90
|
||||
weight: 90
|
||||
sections_weight: 90
|
||||
draft: false
|
||||
aliases: [/templates/partial/,/layout/chrome/,/extras/analytics/]
|
||||
toc: true
|
||||
---
|
||||
@@ -160,7 +154,7 @@ Note that the variant parameters are not made available to the underlying partia
|
||||
|
||||
The following `header.html` partial template is used for [spf13.com](https://spf13.com/):
|
||||
|
||||
{{< code file="layouts/partials/header.html" download="header.html" >}}
|
||||
{{< code file="layouts/partials/header.html" >}}
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
|
||||
<head>
|
||||
@@ -185,7 +179,7 @@ The `header.html` example partial was built before the introduction of block tem
|
||||
|
||||
The following `footer.html` partial template is used for [spf13.com](https://spf13.com/):
|
||||
|
||||
{{< code file="layouts/partials/footer.html" download="footer.html" >}}
|
||||
{{< code file="layouts/partials/footer.html" >}}
|
||||
<footer>
|
||||
<div>
|
||||
<p>
|
||||
@@ -197,10 +191,10 @@ The following `footer.html` partial template is used for [spf13.com](https://spf
|
||||
</footer>
|
||||
{{< /code >}}
|
||||
|
||||
[context]: /templates/introduction/ "The most easily overlooked concept to understand about Go templating is how the dot always refers to the current context."
|
||||
[customize]: /themes/customizing/ "Hugo provides easy means to customize themes as long as users are familiar with Hugo's template lookup order."
|
||||
[listtemps]: /templates/lists/ "To effectively leverage Hugo's system, see how Hugo handles list pages, where content for sections, taxonomies, and the homepage are listed and ordered."
|
||||
[lookup order]: /templates/lookup-order/ "To keep your templating dry, read the documentation on Hugo's lookup order."
|
||||
[partialcached]: /functions/partialcached/ "Use the partial cached function to improve build times in cases where Hugo can cache partials that don't need to be rendered with every page."
|
||||
[singletemps]: /templates/single-page-templates/ "The most common form of template in Hugo is the single content template. Read the docs on how to create templates for individual pages."
|
||||
[context]: /templates/introduction/
|
||||
[customize]: /hugo-modules/theme-components/
|
||||
[listtemps]: /templates/lists/
|
||||
[lookup order]: /templates/lookup-order/
|
||||
[partialcached]: /functions/partialcached/
|
||||
[singletemps]: /templates/single-page-templates/
|
||||
[themes]: /themes/
|
||||
|
Reference in New Issue
Block a user