Skip to content

GScan will complain about {{author}} usage when passed as data property from routes.yaml #170

Open
@kirrg001

Description

@kirrg001

Ghost API V2 will allow in the near future:

routes.yaml

routes:
  /route/:
    data: author.{slug}

Then you need to use {{author.slug}} in your theme. GScan will complain about this usage.
Not 100% sure how to differentiate single author usages and this use case.

Workaround:

routes:
  /route/:
    data: 
      someone: author.{slug}

{{someone.slug}}


Copied error:

Error ID:
    53f5dd40-4fa9-11e9-9df5-e9882a363da1

Details:
    fatal:    false
    level:    error
    rule:     Replace the <code>{{author.slug}}</code> helper with <code>{{primary_author.slug}}</code> or <code>{{authors.[#].slug}}</code>
    details: 
      """
        The usage of <code>{{author.slug}}</code> is deprecated and should be replaced with either <code>{{primary_author.slug}}</code>
                or <code>{{authors.[#].slug}}</code>.<br>
                Find more information about the <code>{{authors}}</code> helper <a href="https://themes.ghost.org/docs/authors" target=_blank>here</a>.
      """
    regex: 
    helper:   {{author.slug}}
    failures: 
      - 
        ref:     profile.hbs
        message: Please remove or replace {{author.slug}} from this template
    code:     GS001-DEPR-AUTH-SLUG

Related reports:

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