# Theme won't install - authors issue

**URL:** <https://forum.ghost.org/t/theme-wont-install-authors-issue/40797>\
**Category:** Developer help\
**Created:** [August 28, 2023, 1:05pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797 "2023-08-28T13:05:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [August 28, 2023, 1:05pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/1 "2023-08-28T13:05:45Z")

</div>

Latest or nearly so Ghost, local install and/or Ghost Pro, MySQL 8.

I have a theme that runs fine but won’t install. Here’s the error message:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/8/2/820386537c67feadef73c41f728849b8d02b8a43.png)  
Image text: Fatal error: Replace …/author with …/primary\_author or …/authors.[#]

Unfortunately, this is on the author.hbs template. primary\_author doesn’t work there. I tried wrapping in the {{#author}} context, but I’ve got some complexity with a match statement with an else, and these playing well together.

gscan bug?

This is my author.hbs code currently (abbreviated):

```auto
    {{#get "pages" filter="slug:[{{author.slug}}]" limit=1 as |posts counter|}}
        {{#foreach posts}}
        {{> content width="small"}} 
        {{/foreach}}

    {{#match counter.total "=" 1}}
    {{else}}
{{!-- lots more stuff here not shown --}}
            <section class="author container small">
                {{#if ../author.website}}
                    <h1 class="author-name"><a href="{{../author.website}}" target="_blank" rel="noopener noreferrer">{{../author.name}}</a>
                    </h1>
                {{else}}
                    <h1 class="author-name">{{../author.name}}</h1>
                {{/if}}
                

            {{/match}}
            {{/get}}

        <div class="post-feed container medium" style="margin-top:32px">
            {{#foreach posts}}
                {{> "loop"}}
            {{/foreach}}
        </div>

        {{pagination}}
        

```

The code above works great, but it won’t pass Ghost’s theme loading check… Argh!

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [August 28, 2023, 2:45pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/2 "2023-08-28T14:45:57Z")

</div>

what does the “…/” prefix notation mean in Handlebars?

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [August 28, 2023, 2:56pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/3 "2023-08-28T14:56:22Z")

</div>

it bumps the context up a level.

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [August 28, 2023, 5:03pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/4 "2023-08-28T17:03:37Z")

</div>

This is likely an issue with gscan. Does it match anything here? [Issues · TryGhost/gscan · GitHub](https://github.com/TryGhost/gscan/issues).

If you moved the problematic bit into a partial, does it avoid the error?

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [August 28, 2023, 5:22pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/5 "2023-08-28T17:22:20Z")

</div>

It’s probably a relative of this one: [Gscan complains about correct usage of `{{author}}` in context of `default.hbs` · Issue #365 · TryGhost/gscan · GitHub](https://github.com/TryGhost/gscan/issues/365)

Except mine’s a fatal error, not just a ‘throw the error and install the theme anyway’ error.

The problem I’m hitting is that I need to do that get to see if there’s a page with the author slug’s slug, and then fall back to showing the author page specified below if not. I can’t close the ‘get’ because I lose the counter variable, but with it open, the {{#author}} context doesn’t work. I fussed around with if vs match vs etc to see if behavior as different, but it wasn’t.

I have settled for the moment for adding a style tag within the #foreach with CSS styling that hides all the author content that the second section writes out. That’s a dumb solution, but it gets the job done.

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [August 28, 2023, 6:34pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/6 "2023-08-28T18:34:27Z")

</div>

I was exploring whether there were any other workarounds here.

The only other idea I had was to use the `:empty:` CSS selector.

```html
<div class="slug-time"></div>

<div class="no-slug-time">
...
</div>

```

```css
.no-slug-time {
  display: none;
}

.slug-time:empty .no-slug-time {
  display: block;
}

```

The CSS empty selector requires no children, which includes text and whitespace. That means you’ll likely need to use Handlebars whitespace control.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [August 28, 2023, 6:51pm UTC](https://forum.ghost.org/t/theme-wont-install-authors-issue/40797/7 "2023-08-28T18:51:18Z")

</div>

Thanks, but I think writing out the `<style>.no-slug-time {display:none}</style>` style right in the theme file is probably easier to execute and maintain than making sure that `.slug-time` is scrupulously empty. Squashing whitespace in handlebars is a real drag for readability.
