Skip to content

Commit 14202cd

Browse files
authored
Add author profiles (#503)
1 parent cbe384f commit 14202cd

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

layouts/partials/posts/meta.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
<div class="post-meta">
2-
<span class="post-authors">
2+
<span class="post-authors">
33
{{- range .Params.author -}}
4-
<div class="post-author"><i class="fa-solid fa-user"></i> {{ . }}</div>
4+
{{ $author := trim (index (findRE `[^<]*` . 1) 0) "\n\r " }}
5+
{{ $handle := index (index (findRESubmatch `<(.*?)>` . 1) 0) 1 }}
6+
<div class="post-author">
7+
<i class="fa-solid fa-user"></i>
8+
{{ if $handle }}
9+
<a href="/authors/{{ $handle }}">{{ $author }}</a>
10+
{{- else }}
11+
{{- $author }}
12+
{{- end }}
13+
</div>
514
{{- end -}}
615
</span>
716
{{ if .Date }}

0 commit comments

Comments
 (0)