Add a link to the author of the post

This commit is contained in:
Cotes Chung 2021-12-05 02:29:40 +08:00
parent 563e8085e8
commit e2003f2b03
8 changed files with 45 additions and 10 deletions

View File

@ -16,8 +16,23 @@ tail_includes:
<!-- author -->
<div>
{% capture author_name %}{{ page.author.name | default: site.social.name }}{% endcapture %}
{% assign author_link = nil %}
{% if page.author.link %}
{% assign author_link = page.author.link %}
{% elsif author_name == site.social.name %}
{% assign author_link = site.social.links[0] %}
{% endif %}
{{ site.data.locales[lang].post.written_by }}
<em>{{ page.author | default: site.social.name }}</em>
<em>
{% if author_link %}
<a href="{{ author_link }}">{{ author_name }}</a>
{% else %}
{{ author_name }}
{% endif %}
</em>
</div>
<div class="d-flex">

View File

@ -1,6 +1,8 @@
---
title: Text and Typography
author: Cotes Chung
author:
name: Cotes Chung
link: https://github.com/cotes2020
date: 2019-08-08 11:33:00 +0800
categories: [Blogging, Demo]
tags: [typography]

View File

@ -1,6 +1,8 @@
---
title: Writing a New Post
author: Cotes Chung
author:
name: Cotes Chung
link: https://github.com/cotes2020
date: 2019-08-08 14:10:00 +0800
categories: [Blogging, Tutorial]
tags: [writing]

View File

@ -1,6 +1,8 @@
---
title: Getting Started
author: Cotes Chung
author:
name: Cotes Chung
link: https://github.com/cotes2020
date: 2019-08-09 20:55:00 +0800
categories: [Blogging, Tutorial]
tags: [getting started]

View File

@ -1,6 +1,8 @@
---
title: Customize the Favicon
author: Cotes Chung
author:
name: Cotes Chung
link: https://github.com/cotes2020
date: 2019-08-11 00:34:00 +0800
categories: [Blogging, Tutorial]
tags: [favicon]

View File

@ -1,6 +1,8 @@
---
title: Enable Google Page Views
author: Dinesh Prasanth Moluguwan Krishnamoorthy
author:
name: Dinesh Prasanth Moluguwan Krishnamoorthy
link: https://github.com/SilleBille
date: 2021-01-03 18:32:00 -0500
categories: [Blogging, Tutorial]
tags: [google analytics, pageviews]

View File

@ -395,8 +395,6 @@ i { // fontawesome icons
word-spacing: 1px;
a {
@extend %link-underline;
&:not(:last-child) {
margin-right: 2px;
}

View File

@ -22,13 +22,21 @@
padding-right: $pr;
}
%text-color {
color: var(--text-color);
}
h1 + .post-meta {
span + span::before {
@include dot;
}
em {
color: var(--text-color);
@extend %text-color;
a {
@extend %text-color;
}
}
}
@ -45,6 +53,10 @@ h1 + .post-meta {
margin-top: 6rem;
border-bottom: 1px double var(--main-border-color);
font-size: 0.85rem;
.post-meta a {
@extend %link-underline;
}
}
.post-tags {
@ -179,7 +191,7 @@ nav[data-toggle=toc] {
transition: all 0.3s ease-in-out;
h3 {
color: var(--text-color);
@extend %text-color;
}
&:hover {