Fix layout undefined-local crashes (pageTitle/metaDescription/pageName) for runtime compatibility
This commit is contained in:
parent
fa2ac66263
commit
650ef7a4a1
1 changed files with 5 additions and 4 deletions
|
|
@ -3,17 +3,18 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title><%= pageTitle ? `${pageTitle} | ${config.brand.name}` : config.brand.name %></title>
|
<title><%= (typeof pageTitle !== 'undefined' && pageTitle) ? `${pageTitle} | ${config?.brand?.name || 'AutoTQ'}` : (config?.brand?.name || 'AutoTQ') %></title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content="<%= metaDescription || config.brand.tagline %>"
|
content="<%= (typeof metaDescription !== 'undefined' && metaDescription) ? metaDescription : (config?.brand?.tagline || '') %>"
|
||||||
/>
|
/>
|
||||||
<link rel="preconnect" href="https://images.squarespace-cdn.com" />
|
<link rel="preconnect" href="https://images.squarespace-cdn.com" />
|
||||||
<link rel="preconnect" href="https://img.youtube.com" />
|
<link rel="preconnect" href="https://img.youtube.com" />
|
||||||
<link rel="stylesheet" href="/css/style.css" />
|
<link rel="stylesheet" href="/css/style.css" />
|
||||||
</head>
|
</head>
|
||||||
<body class="page-<%= pageName || 'default' %>">
|
<% const _pageName = (typeof pageName !== 'undefined' && pageName) ? pageName : 'default'; %>
|
||||||
<%- include('partials/header', { config, pageName }) %>
|
<body class="page-<%= _pageName %>">
|
||||||
|
<%- include('partials/header', { config, pageName: _pageName }) %>
|
||||||
<main><%- body %></main>
|
<main><%- body %></main>
|
||||||
<%- include('partials/footer', { config }) %>
|
<%- include('partials/footer', { config }) %>
|
||||||
<script src="/js/main.js" defer></script>
|
<script src="/js/main.js" defer></script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue