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="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="theme-color" content="#404040"> <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:site_name" content="{{ .Site.Title }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
{{ .Render "meta" }} {{ .Render "meta" }}
<link rel="icon" href="{{ .Site.BaseURL }}/favicon.ico" /> <link rel="icon" href="{{ .Site.BaseURL }}/favicon.ico" />
<link rel="shortcut icon" href="{{ .Site.BaseURL }}/favicon.ico" type="image/x-icon" /> <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="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .Site.BaseURL }}/index.xml" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" /> {{ end }} <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"> <nav class="pagination is-right" role="navigation" aria-label="pagination">
{{ if $paginator.HasPrev }} {{ 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 }} {{ end }}
{{ if $paginator.HasNext }} {{ 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 }} {{ end }}
<ul class="pagination-list"> <ul class="pagination-list">
{{ range $paginator.Pagers }} {{ range $paginator.Pagers }}
<li> <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> </li>
{{ end }} {{ end }}
</ul> </ul>