diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d3ae4d90..d97fce16 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -12,6 +12,7 @@ {{ partial "tags.html" . }} + {{ partial "page_author.html" . }} {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }} diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index 550c9dcb..47faa039 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -540,25 +540,28 @@ a[data-fancybox] img { margin: 0px 0 10px 0; } -#profile ul.network-icon { +ul.network-icon { display: inline-flex; flex-direction: row; flex-wrap: wrap; justify-content: center; list-style: none; padding: 0; +} + +#profile .network-icon { margin-top: 30px; } -#profile .network-icon li { +.network-icon li { margin-right: 10px; } -#profile .network-icon li:last-of-type { +.network-icon li:last-of-type { margin-right: 0; } -#profile .network-icon li:hover { +.network-icon li:hover { transform: scale(1.2) } @@ -869,6 +872,69 @@ article .article-metadata { } } +/************************************************* + * Author profile card + **************************************************/ + +.author-card { + margin-top: 1rem; + padding-top: 1rem; + border-top: 1px solid rgba(0,0,0,.05); +} + +.dark .author-card { + border-top: 1px solid rgba(255,255,255,.05); +} + +.author-card .portrait { + width: 60px; + height: 60px; + margin: 0 auto; + border-radius: 50%; + object-fit: cover; +} + +.author-card .card-title { + margin-top: 0; + margin-bottom: 15px; + font-weight: 600; + color: rgba(0, 0, 0, 0.84); +} + +.author-card .card-title a { + color: rgba(0, 0, 0, 0.84); +} + +.dark .author-card .card-title, +.dark .author-card .card-title a { + color: rgba(255, 255, 255, 0.84); +} + +.author-card p { + margin-bottom: 5px; +} + +.author-card .card-subtitle { + font-weight: 300; + font-size: 0.8rem; + color: rgba(0, 0, 0, 0.54); + margin-bottom: 7px; +} + +.dark .author-card .card-subtitle { + color: rgba(255, 255, 255, 0.54); +} + +.author-card .card-text { + color: rgba(0, 0, 0, 0.76); + font-size: 0.8rem; + margin-bottom: 4px; +} + +.dark .author-card .card-text { + color: rgba(255, 255, 255, 0.76); +} + /************************************************* * Publications **************************************************/ diff --git a/layouts/partials/page_author.html b/layouts/partials/page_author.html new file mode 100644 index 00000000..010a380f --- /dev/null +++ b/layouts/partials/page_author.html @@ -0,0 +1,37 @@ +{{ if not (or (eq .Site.Params.profile false) (eq .Params.profile false)) }} + +{{ $author := "" }} +{{ if .Params.authors }} + {{ $author = index .Params.authors 0 }} +{{ end }} + +{{/* Display site author if page authors not explicitly specified or if first page author is site author. */}} +{{ if or (not .Params.authors) (eq $author $.Site.Params.name) }} +
+ {{ if $.Site.Params.gravatar }} + Avatar + {{ else if $.Site.Params.avatar }} + Avatar + {{ end }} +
+
{{ $.Site.Params.name }}
+ {{ with $.Site.Params.role }}
{{.}}
{{end}} + {{ with $.Site.Params.bio }}

{{. | markdownify | emojify}}

{{end}} + +
+
+{{end}} +{{end}} diff --git a/layouts/partials/page_metadata.html b/layouts/partials/page_metadata.html index 6ee51405..cbeabf52 100644 --- a/layouts/partials/page_metadata.html +++ b/layouts/partials/page_metadata.html @@ -6,7 +6,7 @@ {{ if $.Params.authors }} {{ $authorLen := len $.Params.authors }}
- {{ range $k, $v := $.Params.authors }} + {{ range $k, $v := $.Params.authors -}} @@ -32,14 +32,14 @@ - {{ if ne $.Site.Params.reading_time false }} + {{ if not (or (eq .Site.Params.reading_time false) (eq .Params.reading_time false)) }} {{ $.ReadingTime }} {{ i18n "minute_read" }} {{ end }} - {{ $comments_enabled := and $.Site.DisqusShortname (not (or $.Site.Params.disable_comments $.Params.disable_comments)) }} + {{ $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) }} diff --git a/layouts/partials/share.html b/layouts/partials/share.html index fdd31c32..118264fd 100644 --- a/layouts/partials/share.html +++ b/layouts/partials/share.html @@ -1,4 +1,4 @@ -{{ if .Site.Params.sharing }} +{{ if and .Site.Params.sharing (ne .Params.share false) }} {{ partial "tags.html" . }} + {{ partial "page_author.html" . }} {{ $page := . }} {{ $project := .Slug }} diff --git a/layouts/publication/single.html b/layouts/publication/single.html index 5530e816..dcc4ec0f 100644 --- a/layouts/publication/single.html +++ b/layouts/publication/single.html @@ -80,6 +80,7 @@
{{ .Content }}
{{ partial "tags.html" . }} + {{ partial "page_author.html" . }}
diff --git a/layouts/talk/single.html b/layouts/talk/single.html index 27963ffa..39022a6c 100644 --- a/layouts/talk/single.html +++ b/layouts/talk/single.html @@ -91,6 +91,7 @@ {{ partial "tags.html" . }} + {{ partial "page_author.html" . }}