Posts under Author Directory

I am using the latest Ghost v3.14 and trying to set up my routes according to authors.

Theme - Casper (default)
Authors - Alice and Bob
4 Posts - AlicePost1, AlicePost2, BobPost1, BobPost2
Note: No posts will have 2 authors.

Expecting Result -
Index Page (Homepage) - Default - All posts-cards as default with author names, excerpts etc.

Rest, all these posts are under their respective author directory.

  • example[dot]com/alice/AlicePost1
  • example[dot]comalice/AlicePost2
  • example[dot]com/bob/BobPost1
  • example[dot]com/bob/BobPost2

Hence, I want the route file to move the posts under their respective authors. Tried multiple configurations in last 2-3 days before jumping here. Any help?

You can change permalink: /{slug}/ to permalink: /{primary_author}/{slug}/ in routes.yaml.

It should look like:

collections:
  /:
    permalink: /{primary_author}/{slug}/
    template: index

Thanks @minimaluminium. Can similar route be performed on the pages as well?

As far as I know, the permalink is only available for content collections, so I think it’s not possible. But I might be wrong.

1 Like