Skip to content

Commit c0d900e

Browse files
committed
Add author page
1 parent 685a807 commit c0d900e

File tree

5 files changed

+36
-14
lines changed

5 files changed

+36
-14
lines changed

assets/scss/_author-bio.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.author-bio {
2+
box-sizing: border-box;
3+
margin: 0 auto;
4+
max-width: 650px;
5+
padding: 0 calc(var(--mm-spacing) / 2) calc(var(--mm-spacing) / 2);
6+
width: 100%;
7+
8+
@media (min-width: 768px) {
9+
box-sizing: unset;
10+
}
11+
}

assets/scss/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
@use 'search';
1313
@use 'variables';
1414
@use 'recaptcha';
15+
@use 'author-bio';
1516
@use 'post-author-bio';
1617

1718
:root {

content/authors/christopher-luna.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
title: "Christopher Luna"
33
linkedin: "https://www.linkedin.com/in/christophermluna"
44
---
5+
56
Christopher Luna works at MaxMind. MaxMind employs Christopher. Hello!

layouts/authors/single.html

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
{{ define "main" }}
2-
<div class="article">
3-
<div class="article__container">
4-
<div class="author-bio">
5-
<h1>Articles by {{ .Title }}</h1>
6-
<p>{{ .Content }}</p>
7-
{{ if ne .Params.linkedin "" }}
8-
<p>
9-
<a href="{{ .Params.linkedin }}" target="_blank" rel="noopener noreferrer">
10-
Connect with {{ .Title }} on LinkedIn
11-
</a>
12-
</p>
13-
{{ end }}
14-
</div>
2+
<div class="author-bio article__container">
3+
<h1>Posts by {{ .Title }}</h1>
4+
<p>{{ .Content }}</p>
5+
{{ if ne .Params.linkedin "" }}
6+
<p>
7+
<a href="{{ .Params.linkedin }}" target="_blank" rel="noopener noreferrer">
8+
Connect with {{ .Title }} on LinkedIn
9+
</a>
10+
</p>
11+
{{ end }}
12+
</div>
13+
14+
<hr />
15+
16+
{{ $posts := where .Site.RegularPages "Params.authors" "intersect" (slice .Title) }}
17+
{{ if $posts }}
18+
<div class="blog-posts__wrapper">
19+
<div class="blog-posts">
20+
{{ range $posts }}
21+
{{ partial "post-list.html" . }}
22+
{{ end }}
1523
</div>
1624
</div>
25+
{{ end }}
1726
{{ end }}

layouts/partials/post-author-bio.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ $authorPages := where .Site.Pages "Section" "authors" }}
22
{{ $authorPages := where $authorPages "Title" "in" .Params.authors }}
33

4-
{{ if gt (len $authorPages) 0 }}
4+
{{ if $authorPages }}
55
<hr />
66
<div class="post-author-bio article__container">
77
{{ if gt (len $authorPages) 1 }}

0 commit comments

Comments
 (0)