mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-11 15:49:17 -04:00
Fix indentation and broken image
This commit is contained in:
parent
48ad4124e1
commit
8dbe5df90b
@ -85,19 +85,19 @@ You can show content summaries with the following code. You could use the follow
|
|||||||
|
|
||||||
{{< code file="page-list-with-summaries.html" >}}
|
{{< code file="page-list-with-summaries.html" >}}
|
||||||
{{ range first 10 .Pages }}
|
{{ range first 10 .Pages }}
|
||||||
<article>
|
<article>
|
||||||
<!-- this <div> includes the title summary -->
|
<!-- this <div> includes the title summary -->
|
||||||
<div>
|
<div>
|
||||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
</div>
|
</div>
|
||||||
{{ if .Truncated }}
|
{{ if .Truncated }}
|
||||||
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
|
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
|
||||||
<div>
|
<div>
|
||||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
@ -50,17 +50,17 @@ The following is an example of a very basic [single page template]:
|
|||||||
|
|
||||||
{{< code file="layout/_default/single.html" >}}
|
{{< code file="layout/_default/single.html" >}}
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
<article>
|
<article>
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
</header>
|
</header>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</article>
|
</article>
|
||||||
<aside>
|
<aside>
|
||||||
{{ .TableOfContents }}
|
{{ .TableOfContents }}
|
||||||
</aside>
|
</aside>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
@ -62,12 +62,12 @@ The following example lists the items of an RSS feed:
|
|||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ with resources.GetRemote "https://example.com/rss.xml" | transform.Unmarshal }}
|
{{ with resources.GetRemote "https://example.com/rss.xml" | transform.Unmarshal }}
|
||||||
{{ range .channel.item }}
|
{{ range .channel.item }}
|
||||||
<strong>{{ .title | plainify | htmlUnescape }}</strong><br />
|
<strong>{{ .title | plainify | htmlUnescape }}</strong><br>
|
||||||
<p>{{ .description | plainify | htmlUnescape }}</p>
|
<p>{{ .description | plainify | htmlUnescape }}</p>
|
||||||
{{ $link := .link | plainify | htmlUnescape }}
|
{{ $link := .link | plainify | htmlUnescape }}
|
||||||
<a href="{{ $link }}">{{ $link }}</a><br />
|
<a href="{{ $link }}">{{ $link }}</a><br>
|
||||||
<hr>
|
<hr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
@ -22,20 +22,20 @@ The following might be used as a partial within a [single page template][singlet
|
|||||||
|
|
||||||
{{< code file="layouts/partials/content-header.html" >}}
|
{{< code file="layouts/partials/content-header.html" >}}
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
{{ with .Params.location }}
|
{{ with .Params.location }}
|
||||||
<div><a href="/locations/{{ . | urlize }}">{{ . }}</a></div>
|
<div><a href="/locations/{{ . | urlize }}">{{ . }}</a></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<!-- Creates a list of tags for the content and links to each of their pages -->
|
<!-- Creates a list of tags for the content and links to each of their pages -->
|
||||||
{{ with .Params.tags }}
|
{{ with .Params.tags }}
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .}}
|
{{ range .}}
|
||||||
<li>
|
<li>
|
||||||
<a href="/tags/{{ . | urlize }}">{{ . }}</a>
|
<a href="/tags/{{ . | urlize }}">{{ . }}</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@ aliases: [/0-25/]
|
|||||||
|
|
||||||
Hugo `0.25` is the **Kinder Surprise**: It automatically opens the page you're working on in the browser, it adds full `AND` and `OR` support in page queries, and you can now have templates per language.
|
Hugo `0.25` is the **Kinder Surprise**: It automatically opens the page you're working on in the browser, it adds full `AND` and `OR` support in page queries, and you can now have templates per language.
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
If you start with `hugo server --navigateToChanged`, Hugo will navigate to the relevant page on save (see animated GIF). This is extremely useful for site-wide edits. Another very useful feature in this version is the added support for `AND` (`intersect`) and `OR` (`union`) filters when combined with `where`.
|
If you start with `hugo server --navigateToChanged`, Hugo will navigate to the relevant page on save (see animated GIF). This is extremely useful for site-wide edits. Another very useful feature in this version is the added support for `AND` (`intersect`) and `OR` (`union`) filters when combined with `where`.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -40,7 +40,7 @@ The following is an example of a homepage template that uses [partial][partials]
|
|||||||
<header class="homepage-header">
|
<header class="homepage-header">
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
{{ with .Params.subtitle }}
|
{{ with .Params.subtitle }}
|
||||||
<span class="subtitle">{{ . }}</span>
|
<span class="subtitle">{{ . }}</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
<div class="homepage-content">
|
<div class="homepage-content">
|
||||||
@ -49,7 +49,7 @@ The following is an example of a homepage template that uses [partial][partials]
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ range first 10 .Site.RegularPages }}
|
{{ range first 10 .Site.RegularPages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@ -166,13 +166,13 @@ This list template has been modified slightly from a template originally used in
|
|||||||
{{ partial "subheader.html" . }}
|
{{ partial "subheader.html" . }}
|
||||||
<main>
|
<main>
|
||||||
<div>
|
<div>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<!-- Renders the li.html content view for each content/posts/*.md -->
|
<!-- Renders the li.html content view for each content/posts/*.md -->
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
{{ .Render "li" }}
|
{{ .Render "li" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "footer.html" . }}
|
||||||
@ -184,10 +184,10 @@ This list template has been modified slightly from a template originally used in
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
<div>
|
<div>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
|
<!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@ -46,17 +46,17 @@ Examples:
|
|||||||
{{< code file="layouts/_default/section.html" >}}
|
{{< code file="layouts/_default/section.html" >}}
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
<ul class="contents">
|
<ul class="contents">
|
||||||
{{ range .Paginator.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
<li>{{ .Title }}
|
<li>{{ .Title }}
|
||||||
<div>
|
<div>
|
||||||
{{ partial "summary.html" . }}
|
{{ partial "summary.html" . }}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ partial "pagination.html" . }}
|
{{ partial "pagination.html" . }}
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
@ -36,10 +36,10 @@ This single page template makes use of Hugo [base templates], the [`.Format` fun
|
|||||||
</section>
|
</section>
|
||||||
<aside id="meta">
|
<aside id="meta">
|
||||||
<div>
|
<div>
|
||||||
<section>
|
<section>
|
||||||
<h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
|
<h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
|
||||||
<h5 id="wordcount"> {{ .WordCount }} Words </h5>
|
<h5 id="wordcount"> {{ .WordCount }} Words </h5>
|
||||||
</section>
|
</section>
|
||||||
{{ with .GetTerms "topics" }}
|
{{ with .GetTerms "topics" }}
|
||||||
<ul id="topics">
|
<ul id="topics">
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user