Using the author scope outside of author.hbs causes gscan errorí

Ghost v5.74.5 (self hosted) / Node 18 (mac/ubuntu)
gscan v4.42.0

my theme uses a hero-header.hbs file that is inserted on all index/post/page/tag/author pages. For the author pages I use the, author.url etc data in the hero header. Although this does work, it creates an gscan error (see below).

I am not sure if I’m doing it wrong, or this is a bug in gscan? Can anyone offer me any advice please?

many thanks

Error: The {{#if author.}} block helper should be replaced with {{#if primary_author.}} or {{#if authors.[#].}}*

a similar issue was reported a few years ago, but it seems was not resolved. there is also a bug (issue #457) reported on gscan that results in the same error, but I am not sure it is related.

apologies, I was doing it wrong.

The error messages are saying that the author scope is deprecated for posts and pages now that multiple authors can assigned (use authors & primary_author instead).

I think the correct way to do what I was attempting is to set the relevant scope in post.hbs/page.hbs/tag.hbs/author.hbs and then do the {{> hero-header}} insert from there.

I will leave the original question up in case it helps anyone else.

1 Like