mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-25 07:48:52 +00:00
e4824eb3fe
Passing the shortcode into the Markdown processor just to get pre and code tags does not make much sense.
1.8 KiB
1.8 KiB
title, description, date, publishdate, lastmod, categories, menu, godocref, signature, hugoversion, deprecated, workson, relatedfuncs
| title | description | date | publishdate | lastmod | categories | menu | godocref | signature | hugoversion | deprecated | workson | relatedfuncs | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| urlize | Takes a string, sanitizes it for usage in URLs, and converts spaces to hyphens. | 2017-02-01 | 2017-02-01 | 2017-02-01 |
|
|
|
false |
The following examples pull from a content file with the following front matter:
{{< code file="content/blog/greatest-city.md" copy="false">}} +++ title = "The World's Greatest City" location = "Chicago IL" tags = ["pizza","beer","hot dogs"] +++ {{< /code >}}
The following might be used as a partial within a single page template:
{{< code file="layouts/partials/content-header.html" download="content-header.html" >}}
{{.Title}}
{{ with .Params.location }} {{ end }} {{ with .Params.tags }}-
{{range .}}
- {{ . }} {{end}}
The preceding partial would then output to the rendered page as follows, assuming the page is being built with Hugo's default pretty URLs.
{{< output file="/blog/greatest-city/index.html" >}}