gscan icon indicating copy to clipboard operation
gscan copied to clipboard

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

Open adamkudrna opened this issue 5 years ago • 1 comments

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 avatar Nov 15 '20 20:11 adamkudrna

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 avatar Mar 29 '22 06:03 naz