Fix indentation and broken image

This commit is contained in:
Joe Mooring 2023-08-06 10:03:11 -07:00 committed by GitHub
parent 48ad4124e1
commit 8dbe5df90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 61 additions and 63 deletions

View File

@ -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" >}}
{{ range first 10 .Pages }}
<article>
<!-- this <div> includes the title summary -->
<div>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ .Summary }}
</div>
{{ if .Truncated }}
<article>
<!-- this <div> includes the title summary -->
<div>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ .Summary }}
</div>
{{ if .Truncated }}
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
<div>
<a href="{{ .RelPermalink }}">Read More…</a>
</div>
{{ end }}
</article>
{{ end }}
</article>
{{ end }}
{{< /code >}}

View File

@ -50,17 +50,17 @@ The following is an example of a very basic [single page template]:
{{< code file="layout/_default/single.html" >}}
{{ define "main" }}
<main>
<main>
<article>
<header>
<header>
<h1>{{ .Title }}</h1>
</header>
{{ .Content }}
</header>
{{ .Content }}
</article>
<aside>
{{ .TableOfContents }}
{{ .TableOfContents }}
</aside>
</main>
</main>
{{ end }}
{{< /code >}}

View File

@ -62,12 +62,12 @@ The following example lists the items of an RSS feed:
```go-html-template
{{ with resources.GetRemote "https://example.com/rss.xml" | transform.Unmarshal }}
{{ range .channel.item }}
<strong>{{ .title | plainify | htmlUnescape }}</strong><br />
<p>{{ .description | plainify | htmlUnescape }}</p>
{{ $link := .link | plainify | htmlUnescape }}
<a href="{{ $link }}">{{ $link }}</a><br />
<hr>
{{ end }}
{{ range .channel.item }}
<strong>{{ .title | plainify | htmlUnescape }}</strong><br>
<p>{{ .description | plainify | htmlUnescape }}</p>
{{ $link := .link | plainify | htmlUnescape }}
<a href="{{ $link }}">{{ $link }}</a><br>
<hr>
{{ end }}
{{ end }}
```

View File

@ -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" >}}
<header>
<h1>{{ .Title }}</h1>
{{ with .Params.location }}
<div><a href="/locations/{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
<!-- Creates a list of tags for the content and links to each of their pages -->
{{ with .Params.tags }}
<h1>{{ .Title }}</h1>
{{ with .Params.location }}
<div><a href="/locations/{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
<!-- Creates a list of tags for the content and links to each of their pages -->
{{ with .Params.tags }}
<ul>
{{ range .}}
<li>
<a href="/tags/{{ . | urlize }}">{{ . }}</a>
</li>
{{ end }}
{{ range .}}
<li>
<a href="/tags/{{ . | urlize }}">{{ . }}</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</header>
{{< /code >}}

View File

@ -9,8 +9,6 @@ aliases: [/0-25/]
Hugo `0.25` is the **Kinder Surprise**: It automatically opens the page you&#39;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 Open on Save](https://cdn-standard5.discourse.org/uploads/gohugo/optimized/2X/6/622088d4a8eacaf62bbbaa27dab19d789e10fe09_1_690x345.gif "Hugo Open on Save")
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:

View File

@ -40,7 +40,7 @@ The following is an example of a homepage template that uses [partial][partials]
<header class="homepage-header">
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
<span class="subtitle">{{ . }}</span>
{{ end }}
</header>
<div class="homepage-content">
@ -49,7 +49,7 @@ The following is an example of a homepage template that uses [partial][partials]
</div>
<div>
{{ range first 10 .Site.RegularPages }}
{{ .Render "summary" }}
{{ .Render "summary" }}
{{ end }}
</div>
</main>

View File

@ -166,13 +166,13 @@ This list template has been modified slightly from a template originally used in
{{ partial "subheader.html" . }}
<main>
<div>
<h1>{{ .Title }}</h1>
<ul>
<!-- Renders the li.html content view for each content/posts/*.md -->
{{ range .Pages }}
{{ .Render "li" }}
{{ end }}
</ul>
<h1>{{ .Title }}</h1>
<ul>
<!-- Renders the li.html content view for each content/posts/*.md -->
{{ range .Pages }}
{{ .Render "li" }}
{{ end }}
</ul>
</div>
</main>
{{ partial "footer.html" . }}
@ -184,10 +184,10 @@ This list template has been modified slightly from a template originally used in
{{ define "main" }}
<main>
<div>
<h1>{{ .Title }}</h1>
<!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
<h1>{{ .Title }}</h1>
<!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
{{ range .Pages }}
{{ .Render "summary" }}
{{ .Render "summary" }}
{{ end }}
</div>
</main>

View File

@ -46,17 +46,17 @@ Examples:
{{< code file="layouts/_default/section.html" >}}
{{ define "main" }}
<main>
{{ .Content }}
<ul class="contents">
{{ range .Paginator.Pages }}
<li>{{ .Title }}
<div>
{{ partial "summary.html" . }}
</div>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" . }}
{{ .Content }}
<ul class="contents">
{{ range .Paginator.Pages }}
<li>{{ .Title }}
<div>
{{ partial "summary.html" . }}
</div>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" . }}
</main>
{{ end }}
{{< /code >}}

View File

@ -36,10 +36,10 @@ This single page template makes use of Hugo [base templates], the [`.Format` fun
</section>
<aside id="meta">
<div>
<section>
<h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
<h5 id="wordcount"> {{ .WordCount }} Words </h5>
</section>
<section>
<h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
<h5 id="wordcount"> {{ .WordCount }} Words </h5>
</section>
{{ with .GetTerms "topics" }}
<ul id="topics">
{{ range . }}