layouts: use new Hugo context syntax

This commit is contained in:
liushuyu 2022-05-07 16:09:06 -06:00
parent c728f3c459
commit f286ee6320
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437
2 changed files with 5 additions and 5 deletions

View File

@ -7,14 +7,14 @@
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="theme-color" content="#404040">
<meta property="og:title" content="{{ if ne .URL " / " }}{{ .Title }} &middot; {{ end }}{{ .Site.Title }}" />
<meta property="og:title" content="{{ if ne .RelPermalink " / " }}{{ .Title }} &middot; {{ end }}{{ .Site.Title }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{ .Render "meta" }}
<link rel="icon" href="{{ .Site.BaseURL }}/favicon.ico" />
<link rel="shortcut icon" href="{{ .Site.BaseURL }}/favicon.ico" type="image/x-icon" />
<link rel="canonical" href="{{ .Permalink }}"> {{ if .RSSLink }}
<link rel="canonical" href="{{ .Permalink }}"> {{ if .OutputFormats.Get "RSS" }}
<link href="{{ .Site.BaseURL }}/index.xml" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .Site.BaseURL }}/index.xml" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" /> {{ end }}

View File

@ -7,17 +7,17 @@
<nav class="pagination is-right" role="navigation" aria-label="pagination">
{{ if $paginator.HasPrev }}
<a class="pagination-previous" href="{{ $paginator.Prev.URL }}">Previous Page</a>
<a class="pagination-previous" href="{{ $paginator.Prev.RelPermalink }}">Previous Page</a>
{{ end }}
{{ if $paginator.HasNext }}
<a class="pagination-next" href="{{ $paginator.Next.URL }}">Next Page</a>
<a class="pagination-next" href="{{ $paginator.Next.RelPermalink }}">Next Page</a>
{{ end }}
<ul class="pagination-list">
{{ range $paginator.Pagers }}
<li>
<a class="pagination-link" aria-label="Goto page {{ .PageNumber}}" href="{{ .URL }}">{{ .PageNumber }}</a>
<a class="pagination-link" aria-label="Goto page {{ .PageNumber}}" href="{{ .RelPermalink }}">{{ .PageNumber }}</a>
</li>
{{ end }}
</ul>