Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gscan complains about correct usage of {{author}} in context of default.hbs #365

Open
adamkudrna opened this issue Nov 15, 2020 · 1 comment
Labels

Comments

@adamkudrna
Copy link

This is the logic of my theme's page title in default.hbs which actually works:

    <title>
        {{#is "home"}}
            {{@site.title}}{{@site.description}}
        {{/is}}
        {{#is "author"}}
            {{author.name}} | {{@site.title}}
        {{/is}}
        {{#is "tag"}}
            {{tag.name}} | {{@site.title}}
        {{/is}}
        {{^is "home, author, tag"}}
            {{meta_title}} | {{@site.title}}
        {{/is}}
    </title>

However, when I run gcan (the latest version, 3.6.0), it throws an error saying:

Checking theme compatibility...

Your theme has 1 error!
----

Errors
------
Important to fix, functionality may be degraded.

- Error: Replace the {{author.name}} helper with {{primary_author.name}} or {{authors.[#].name}}
Files: default.hbs

I think this is a false alarm which should be fixed (I wish I could do it).

adamkudrna added a commit to frontend-garden/frontend-garden-ghost-theme that referenced this issue Nov 15, 2020
Gscan is temporarily disabled from `npm test` since it raises false alarm on usage of `author` in `default.hbs`.
Reported to Gscan as TryGhost/gscan#365.
adamkudrna added a commit to frontend-garden/frontend-garden-ghost-theme that referenced this issue Nov 16, 2020
Gscan is temporarily disabled from `npm test` since it raises false alarm on usage of `author` in `default.hbs`.
Reported to Gscan as TryGhost/gscan#365.
adamkudrna added a commit to frontend-garden/frontend-garden-ghost-theme that referenced this issue Nov 16, 2020
Gscan is temporarily disabled from `npm test` since it raises false alarm on usage of `author` in `default.hbs`.
Reported to Gscan as TryGhost/gscan#365.
@naz
Copy link
Contributor

naz commented Mar 29, 2022

This issue is a good example of why migrating to AST-based rules for author-related errors like done here is a good idea.

@naz naz added the bug label Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants