Skip to content

Multiple Author Support

Utkarsh Verma edited this page Sep 2, 2018 · 1 revision

Sometimes a single website may host posts written by different authors. It is worth noticing that the hosting of the posts is just as important as mentioning their respective authors. Keeping this in mind, Dream Plus enables the user to separately define a post's author easily through it's frontmatter.

The author of the post is described through the share card of the concerned post. Therefore, to use this feature, share card feature must be enabled. Instructions for enabling it are covered in its wiki here: Share Card

Usage

Dream Plus fetches the author's name from config.toml by default for all posts. This has been done considering the fact that it will be used majorly for personal blog purposes, where there's only one blogger.

Specifying an author explicitly requires declaration of some page variables in the post's frontmatter. This has to be done by means of a dictionary. The syntax for it is as follows:

---
...... # Rest of the frontmatter 
author:
  name: "Author's Name"
  desc: "A short description of the author."
  avatar: "Link to author's avatar(can be from the internet)"
  twitter: "Twitter username"

# or to do it in shorthand
author: {name: "", desc: "", avatar: "", twitter: ""}
---

The above stated frontmatter syntax is in YAML which isn't compulsory, other Hugo compatible formats will also work, as long as they comply to conversion as stated over here: Front-Matter Formats

This will specify the author's details to Dream Plus. A few things to note concerning this feature are:

  • If author.name holds the same value as in config.toml's author variale, then the rest of the variables fall back to the default config.toml values if they are left undefined.
  • Not defining any of the dictionary variables also causes them to fall back to the default config.toml variables.
  • While this does describe the author post-wise, this doesn't affect the sidebar's author details which is meant for describing the website's owner.
Clone this wiki locally