Skip to content

Commit

Permalink
add/edit page_metadata.html
Browse files Browse the repository at this point in the history
  • Loading branch information
leewujung committed Nov 3, 2024
1 parent 02e4bdb commit 2ad0073
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion content/group/communication/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Documentation: https://sourcethemes.com/academic/docs/managing-content/
title: "Communication within group"
date: 2023-09-19
# date: 2023-09-19
authors:
slug: communication
weight: 40
Expand Down
67 changes: 67 additions & 0 deletions layouts/partials/page_metadata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{ $is_list := .is_list }}
{{ $page := .page }}

<div class="article-metadata">

{{/* If `authors` is set and is not empty. */}}
{{ if $page.Params.authors }}
{{ $authorLen := len $page.Params.authors }}
{{ if gt $authorLen 0 }}
<div>
{{ partial "page_metadata_authors" $page }}
</div>
{{ end }}
{{ end }}

{{ if not (in (slice "talk" "page" "project" "group") $page.Type) }}
<span class="article-date">
{{ $date := $page.Lastmod.Format site.Params.date_format }}
{{ if eq $page.Type "publication" }}
{{ $date = $page.Date.Format (site.Params.publications.date_format | default "January, 2006") }}
{{ else }}
{{ if ne $page.Params.Lastmod $page.Params.Date }}
{{ i18n "last_updated" }}
{{ end }}
{{ end }}
{{ $date }}
</span>
{{ end }}

{{ if and (eq $is_list 1) (eq $page.Type "publication") }}
<span class="middot-divider"></span>
<span class="pub-publication">
{{ if $page.Params.publication_short }}
{{ $page.Params.publication_short | markdownify }}
{{ else if $page.Params.publication }}
{{ $page.Params.publication | markdownify }}
{{ end }}
</span>
{{ end }}

{{ if and (eq $page.Type "post") (not (or (eq site.Params.reading_time false) (eq $page.Params.reading_time false))) }}
<span class="middot-divider"></span>
<span class="article-reading-time">
{{ $page.ReadingTime }} {{ i18n "minute_read" }}
</span>
{{ end }}

{{/* Show Disqus comment count if enabled. */}}
{{ $disqus_enabled := eq site.Params.comments.engine 1 | and (index site.Params.comments.commentable $page.Type) | and (ne $page.Params.commentable false) | or $page.Params.commentable }}
{{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
<span class="middot-divider"></span>
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
{{ end}}

{{ $taxonomy := "categories" }}
{{ if $page.Param $taxonomy }}
<span class="middot-divider"></span>
<span class="article-categories">
<i class="fas fa-folder mr-1"></i>
{{- range $index, $value := ($page.GetTerms $taxonomy) -}}
{{- if gt $index 0 }}, {{ end -}}
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end -}}
</span>
{{ end }}

</div>

0 comments on commit 2ad0073

Please sign in to comment.