Harden header partial against missing config/nav locals to prevent 500s
This commit is contained in:
parent
650ef7a4a1
commit
d0261367a4
1 changed files with 4 additions and 4 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
<header class="site-header" id="siteHeader">
|
<header class="site-header" id="siteHeader">
|
||||||
<div class="container nav-wrap">
|
<div class="container nav-wrap">
|
||||||
<a href="/" class="brand" aria-label="<%= config.brand.name %> home">
|
<a href="/" class="brand" aria-label="<%= (config?.brand?.name || 'AutoTQ') %> home">
|
||||||
<img src="<%= config.assets.logo %>" alt="<%= config.brand.name %> logo" loading="eager" />
|
<img src="<%= config?.assets?.logo || '' %>" alt="<%= (config?.brand?.name || 'AutoTQ') %> logo" loading="eager" />
|
||||||
<span><%= config.brand.name %></span>
|
<span><%= (config?.brand?.name || 'AutoTQ') %></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<nav class="site-nav" id="siteNav" aria-label="Primary navigation">
|
<nav class="site-nav" id="siteNav" aria-label="Primary navigation">
|
||||||
<% config.nav.forEach(item => { %>
|
<% (config?.nav || []).forEach(item => { %>
|
||||||
<a href="<%= item.href %>" class="<%= pageName === item.label.toLowerCase() || (pageName === 'home' && item.href === '/') ? 'active' : '' %>">
|
<a href="<%= item.href %>" class="<%= pageName === item.label.toLowerCase() || (pageName === 'home' && item.href === '/') ? 'active' : '' %>">
|
||||||
<%= item.label %>
|
<%= item.label %>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue