Skip to content

Unable to use {{#author}} in author-:slug.hbs #457

@SkippyTheLost

Description

@SkippyTheLost

Issue Summary

I'm not able to use {{#author}} in an author-:slug.hbs file, due to that helper being deprecated.

The documentation here specifies that the {{#author}} helper can be used in author.hbs and author-:slug.hbs files.

If I activate the theme in Ghost, and then add the author-:slug.hbs file, bypassing the theme validator, the {{#author}} helper works as expected.

Steps to Reproduce

  1. Fork a theme (I'm using Casper)
  2. Create an author-:slug.hbs file. (author-april.hbs for example).
  3. Upload to Ghost and attempt to activate, or use a GitHub action to process with Theme Validator. It fails due to {{#author}} being deprecated.

Ghost Version

N/A

Node.js Version

N/A

How did you install Ghost?

Docker

Database type

MySQL 8

Browser & OS version

No response

Relevant log / error output

{
  "name": "ThemeValidationError",
  "context": null,
  "type": "ThemeValidationError",
  "details": {
    "checkedVersion": "5.x",
    "name": "casper",
    "path": "/tmp/5b88c8f1-d260-4fbd-90c8-f0fff3a993fd",
    "version": "5.4.1",
    "errors": [
      {
        "fatal": true,
        "level": "error",
        "rule": "The <code>{{#author}}</code> block helper should be replaced with <code>{{#primary_author}}</code> or <code>{{#foreach authors}}...{{/foreach}}</code>",
        "details": "The usage of <code>{{#author}}</code> block helper outside of <code>author.hbs</code> is no longer supported andshould be replaced with <code>{{#primary_author}}</code> or <code>{{#foreach authors}}...{{/foreach}}</code>.<br>Ghost allows multiple authors to be assigned to a post, so all helpers have been reworked to account for this.<br>Find more information about the <code>{{authors}}</code> helper <a href=\"https://ghost.org/docs/themes/helpers/authors/\" target=_blank>here</a>",
        "regex": {},
        "notValidIn": "author.hbs",
        "helper": "{{#author}}",
        "failures": [
          {
            "ref": "author-april.hbs",
            "message": "Please remove or replace {{#author}} from this template"
          }
        ],
        "code": "GS001-DEPR-AUTHBL"
      }
    ]
  },
  "property": null,
  "help": null,
  "code": null,
  "id": "e640bd60-63e0-11ed-8f1c-470fc967c6af",
  "ghostErrorCode": null
}

Code of Conduct

  • I agree to be friendly and polite to people in this repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions