Files
HugoBlox-kit/layouts/partials/page_metadata.html
T
George Cushen 7c2a85c351 feat: improve listings
- link author profile pages in listings
- display author name (rather than username) in metadata
- refactor `list_format` to `view` and use new consistent mappings
- add `citation_style` in `params.toml`
- re-order Accomplishments widget in Demo
- make params/comments more consistent in all widget front matter
- Author page: don't show username if profile exists as that will
  already show the user's display name
- Publication card: move author and publication name to metadata bar to
  be consistent with other listings
- Remove portrait.jpg from static as it was duplicated for Demo author

BREAKING CHANGES: See issue below.

See #909
2019-02-04 22:14:28 +00:00

77 lines
2.4 KiB
HTML

{{ $is_list := .is_list }}
{{ $share := .share | default false }}
{{ $ := .content }}
<meta content="{{ $.Params.Date }}" itemprop="datePublished">
<meta content="{{ $.Params.LastMod }}" itemprop="dateModified">
<div class="article-metadata">
{{/* If `authors` is set and is not empty. */}}
{{ if $.Params.authors }}
{{ $authorLen := len $.Params.authors }}
{{ if gt $authorLen 0 }}
<div>
{{ partial "page_metadata_authors" $ }}
</div>
{{ end }}
{{ end }}
{{ if not (in (slice "talk" "page") $.Type) }}
<span class="article-date">
{{ $date := $.Lastmod.Format $.Site.Params.date_format }}
{{ if eq $.Type "publication" }}
{{ $date = $.Date.Format ($.Site.Params.publications.date_format | default "January, 2006") }}
{{ else }}
{{ if ne $.Params.Lastmod $.Params.Date }}
{{ i18n "last_updated" }}
{{ end }}
{{ end }}
<time>{{ $date }}</time>
</span>
{{ end }}
{{ if and (eq $is_list 1) (eq $.Type "publication") }}
<span class="middot-divider"></span>
<span class="pub-publication">
{{ if $.Params.publication_short }}
{{ $.Params.publication_short | markdownify }}
{{ else if $.Params.publication }}
{{ $.Params.publication | markdownify }}
{{ end }}
</span>
{{ end }}
{{ if and (eq $.Type "post") (not (or (eq $.Site.Params.reading_time false) (eq $.Params.reading_time false))) }}
<span class="middot-divider"></span>
<span class="article-reading-time">
{{ $.ReadingTime }} {{ i18n "minute_read" }}
</span>
{{ end }}
{{ $comments_enabled := and $.Site.DisqusShortname (not (or $.Site.Params.disable_comments (eq $.Params.comments false))) }}
{{ if and $comments_enabled ($.Site.Params.comment_count | default true) }}
<span class="middot-divider"></span>
<a href="{{ $.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
{{ end}}
{{ if $.Params.categories }}
{{ $categoriesLen := len $.Params.categories }}
{{ if gt $categoriesLen 0 }}
<span class="middot-divider"></span>
<span class="article-categories">
<i class="fas fa-folder"></i>
{{ range $k, $v := $.Params.categories }}
<a href="{{ ($.Site.GetPage (printf "categories/%s" .)).RelPermalink }}">{{ . }}</a>
{{- if lt $k (sub $categoriesLen 1) -}}, {{ end }}
{{ end }}
</span>
{{ end }}
{{ end }}
{{ if $share }}
{{ partial "share.html" $ }}
{{ end }}
</div>