Skip to content

Commit

Permalink
Added support for multiple authors
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Oswalt <[email protected]>
  • Loading branch information
Mierdin committed Nov 18, 2018
1 parent b6d160d commit 91ceaed
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 10 deletions.
4 changes: 2 additions & 2 deletions content/post/2018-10-16-introducing-nre-labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ featured_image: "/images/nrelabs.png"
tags: []
title: "Introducing NRE Labs"
show_reading_time: true
author:
name: Matt Oswalt
authors:
- name: Matt Oswalt
link: https://twitter.com/mierdin
---

Expand Down
4 changes: 2 additions & 2 deletions content/post/2018-10-26-contributor-orientation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ featured_image: "/images/nrelabs.png"
tags: []
title: "This Week in NRE Labs: Contributor Orientation"
show_reading_time: true
author:
name: Derick Winkworth
authors:
- name: Derick Winkworth
link: https://twitter.com/cloudtoad
---

Expand Down
4 changes: 2 additions & 2 deletions content/post/2018-11-01-network-verification-jsnapy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ featured_image: "/images/bug.png"
tags: []
title: "This Week in NRE Labs: Network Verification with JSNAPy"
show_reading_time: true
author:
name: Matt Oswalt
authors:
- name: Matt Oswalt
link: https://twitter.com/mierdin
---

Expand Down
4 changes: 2 additions & 2 deletions content/post/2018-11-09-nre-labs-packet-pushers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ featured_image: "/images/nrelabs.png"
tags: []
title: "NRE Labs on Packet Pushers"
show_reading_time: true
author:
name: Matt Oswalt
authors:
- name: Matt Oswalt
link: https://twitter.com/mierdin
---

Expand Down
4 changes: 2 additions & 2 deletions content/post/2018-11-15-nre-curriculum-as-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ featured_image: "/images/code.jpg"
tags: []
title: 'How NRE Labs Implements "Curriculum-as-Code"'
show_reading_time: true
author:
name: Matt Oswalt
authors:
- name: Matt Oswalt
link: https://twitter.com/mierdin
---

Expand Down
55 changes: 55 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{ define "header" }}
{{/* We can override any block in the baseof file be defining it in the template */}}
{{ partial "page-header.html" . }}
{{ end }}

{{ define "main" }}
{{ $section := .Site.GetPage "section" .Section }}
<article class="flex-l flex-wrap justify-between mw8 center ph3 ph0-l">

<header class="mt4 w-100">
<p class="f6 b helvetica tracked">
{{/*
CurrentSection allows us to use the section title instead of inferring from the folder.
https://gohugo.io/variables/page/#section-variables-and-methods
*/}}
{{with .CurrentSection.Title }}{{. | upper }}{{end}}
</p>
<h1 class="f1 athelas mb1">
{{- .Title -}}
</h1>
{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
by
{{$n := len .Params.authors}}
{{range $i, $e := .Params.authors}}
<a href="{{.link}}" target="_blank">{{.name}}</a>{{ if (and (ge $n 3) (le $i (add $n -2) ))}}, {{end}}{{if eq (add $i 2) $n}} and {{end}}
{{end}} -
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "January 2, 2006" -}}
</time>
{{/*
Show "reading time" and "word count" but only if one of the following are true:
1) A global config `params` value is set `show_reading_time = true`
2) A section front matter value is set `show_reading_time = true`
3) A page front matter value is set `show_reading_time = true`
*/}}
{{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}}
<span class="f6 mv4 dib tracked"> - {{ .ReadingTime}} minutes read</span>
<span class="f6 mv4 dib tracked"> - {{ .WordCount}} words</span>
{{ end }}
</header>

<main class="nested-copy-line-height lh-copy serif f4 nested-links nested-img mid-gray pr4-l w-two-thirds-l">
{{- .Content -}}
{{- partial "tags.html" . -}}
<div class="mt6">
{{ template "_internal/disqus.html" . }}
</div>
</main>

<aside class="w-30-l mt6-l">
{{- partial "menu-contextual.html" . -}}
</aside>

</article>
{{ end }}

0 comments on commit 91ceaed

Please sign in to comment.