hugo-theme-next/layouts/partials/post/header.html

53 lines
2.1 KiB
HTML
Raw Normal View History

{{ with .ctx }}
{{ if $.IsHome }} <h2 {{ else }} <h1 {{ end }} class="post-title" itemprop="name headline">
{{ if and .Weight (gt .Weight 0) }}
<span class="post-sticky-flag" title="{{ T "PostMeta.sticky" }}">
<i class="fa fa-thumbtack"></i>
</span>
{{ end }}
{{ if $.IsHome }}
{{ if and (isset .Params "extlink") (ne .Params.Extlink "") }}
<a href="{{ .Params.Extlink }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
{{ .Title }}
<i class="fa fa-external-link-alt"></i>
</a>
{{ else }}
2022-06-16 17:39:16 +08:00
<a href="{{ .RelPermalink | relLangURL }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
{{ end }}
{{ else }}
{{ .Title }}
{{ if .Site.Params.postEdit.enable }}
{{ $editURL := printf "%s%s" .Site.Params.postEdit.url (path.Clean .File.Path) }}
<a href="{{ $editURL }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-edit-link" title="{{ T "PostMeta.edit" }}"><i class="fa fa-pen-nib"></i></a>
{{ end }}
{{ end }}
{{ if $.IsHome }} </h2> {{ else }} </h1> {{ end }}
{{ $isComment := and (.Scratch.Get "isComment") .Site.Params.waline.comment }}
<div class="post-meta-container">
<div class="post-meta-items">
{{ partial "post/header_meta/created_date.html" . }}
{{ partial "post/header_meta/update_date.html" . }}
{{ partial "post/header_meta/categories.html" . }}
{{ if and $.IsHome (not (isset .Params "extlink")) }}
<div class="post-meta-items">
{{ if .Site.Params.waline.pageView }}
{{ partial "post/header_meta/views.html" . }}
{{ end }}
{{ if $isComment }}
{{ partial "post/header_meta/comments.html" . }}
{{ end }}
</div>
{{ end }}
</div>
{{ if not $.IsHome }}
<div class="post-meta-items">
{{ partial "post/header_meta/words.html" . }}
{{ partial "post/header_meta/readtime.html" . }}
{{ partial "post/header_meta/views.html" . }}
{{ if $isComment }}
{{ partial "post/header_meta/comments.html" . }}
{{ end }}
</div>
{{ end }}
</div>
{{ end }}