How to create author pages in Quartz
# Why author pages
As I am still building this blog, I wanted to add author pages, so a reader always can look who is writing the blog articles if I ever wanted to allow others to write articles on my blog.
# My search process
As Quartz is based on hugo, that’s where I started looking on how to do it on the offical hugo documentation. But it just showed errors when I tried to do it exactly how it is explained there. So I experimented with a few solutions from blogs I found. (Mainly this one on Netlify)
# The Solution
So how does it work?
# 1. Folder Structure
As first step, you need to create the author pages as .md files. Therefore, you need to create the following folder structure:
Note, that the actual .md page is call
_index.md
with an underscore and the folder name is “slugified” (Instead of Moritz Vogel its moritz-vogel)
# 2. Create Taxonomy
In the config.toml
you need to define the “author” taxonomy:
|
|
You need to define the default taxonomies “tag” and “category” if you plan on using them.
# 3. Create And Adjust Page Templates
In order to show the pages properly, I needed to add the following files:
under layouts/authors/list.html
I added:
|
|
Which is the page for one single author. It is available under blog.vogel.business/authors/moritz-vogel I also added an overview page of all authors:
|
|
which is available under blog.vogel.business/authors/
You also need to show all the authors in the article, so I added this to layouts/_default/single.html
|
|
# 4. Add Authors to Pages
Now all you need to do is adding the author to the pages in the YAML-Frontmatter:
|
|