Blog author bios

I can’t figure out a great way to do this and wondering if anyone can give me some ideas. I have multiple authors creating blog posts. At the bottom of each blog post is an “author block”, basically it’s a picture of the author, their name, and a one-line bio. I can easily get the pic & name ({{ .Params.author | urlize }}, {{ .Params.author }}). However, im not sure hey best way to get the bio. Putting this info in front matter would be less than ideal b/c of repetition. I thought about putting a list of all the authors names and bios in the config params and then comparing {{ .Params.author }} to {{ .Site.Params.staff.name }} but i don’t think i know enough about the templating language/go to get this working or if it’s even possible.

This is basically what @DerekPerkins is doing in another post, and @spf13’s answer is about as good as you’re going to get.

(I’m going to be ripping off what was suggested here for my in-development theme, cabaret, even though I’m just running a single-author blog; it shouldn’t be too hard to do.)

Great question! Great minds think alike. :slight_smile: I posted the answer in my original question.

For anyone looking for a theme that implements this principle. See https://github.com/dencold/hasper.

Since your standardization won’t be available till v0.18 (right?), your original solution should definitely be in the docs under Extras >> Author Site Params or Templates. I just spent a few hours combing through and it’s the most straight-forward, I think. Or do you think the data files musician example should give a hint? (Which by the way is a horrible example. What if a bass player picks up the ukulele. Should I duplicate him in data/ukulele/? But i digress).

@renatovargas If you’re ok building the binaries, that PR should be merged in shortly after the 0.17 release.

As for merging it into the docs, maybe if someone submitted a PR, but I’m a little loathe to add author details to the docs knowing that it’s going to be immediately deprecated. That post has lasted for nearly 2 years, so it might be enough for just a little bit more. :slight_smile:

Rightly so. I’m going ahead and just creating a /data/authors folder with yaml files as per your PR, for when it comes out, and wrangling the Params out of there by hand. Hey, but thanks for the author implementation, looks awesome, well thought out!

Glad you like it! FYI, the PR itself is pulling from /data/_authors.