Hey Everyone, I’m experiencing an issue with a custom navigation partial. This is occurring on Ghost 3.12.1
Here is my custom navigation:
/partial/navigation.hbs
{{#if isSecondary}}
{{!-- secondary navigation --}}
{{#foreach @site.navigation}}
<a class=“{{link_class for=(url) class=(concat “nav-” slug)}}” href=“{{url absolute=“true”}}”>{{label}}
{{/foreach}}
{{else}}
{{!-- primary navigation --}}
{{#foreach @site.navigation}}
<li class=“{{link_class for=(url) class=(concat “nav-” slug)}}” role=“menuitem”><a href=“{{url absolute=“true”}}”>{{label}}
{{/foreach}}
{{/if}}
I am using {{#foreach @site.navigation}} because if I just use {{#foreach navigation}} as stated in the docs, I receive an empty response.
I am consuming it in my site-nav.hbs and I noticed that all of my urls are being changed to my home directory, /. My labels are populating properly. Is there any way to retrieve the url?
This works fine using the built in navigation.hbs and only occurs when I create the custom file I listed above.