Skip to content

Commit

Permalink
Merge views subtree
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 12, 2023
2 parents f76cbbc + 8533470 commit 3995bef
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion template/pages/@/layout/inc/logo.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%
// store logo object
const logo = _.settings.logo
? { url: _.settings.logo, alt: _.settings.name }
? { url: (_.assetsPrefix || '') + _.settings.logo, alt: _.settings.name }
: _.store.logo
if (logo && logo.url) {
Expand Down
4 changes: 4 additions & 0 deletions template/pages/@/meta.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ if (pathname) {
}
%>
<% if (_.assetsPrefix) { %>
<link rel="preconnect" href="<%= _.assetsPrefix || '' %>/" crossorigin>
<link rel="dns-prefetch" href="<%= _.assetsPrefix || '' %>/">
<% } %>
<link rel="preconnect" href="https://cdn.jsdelivr.net/" crossorigin>
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net/">
<% if (resource) { %>
Expand Down
2 changes: 1 addition & 1 deletion template/pages/@/scripts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</script>
<% } %>

<script src="/<%= _.route.path.startsWith('/app/') ? 'checkout' : 'storefront' %>.js"></script>
<script src="<%= _.assetsPrefix || '' %>/<%= _.route.path.startsWith('/app/') ? 'checkout' : 'storefront' %>.js"></script>

<%
if (Array.isArray(_.widgets) && _.widgets.length) {
Expand Down
2 changes: 1 addition & 1 deletion template/pages/@/sections/blog.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (Array.isArray(posts) && posts.length) {
<% if (thumbnail) { %>
<a href="/posts/<%= slug %>">
<img
src="<%= thumbnail %>"
src="<%= _.assetsPrefix || '' %><%= thumbnail %>"
class="card-img-top"
alt="<%= title %>"
>
Expand Down
4 changes: 2 additions & 2 deletions template/pages/@/sections/inc/banner.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (opt.img) {
class="img-fluid"
<% } else { %>
class="lozad fade img-fluid"
data-iesrc="<%= opt.img.replace('.webp', '.png') %>"
data-iesrc="<%= _.assetsPrefix || '' %><%= opt.img.replace('.webp', '.png') %>"
data-alt="<%= opt.alt %>"
<% } %>
<% if (!opt.height_auto && width) { %>
Expand All @@ -57,7 +57,7 @@ if (opt.img) {
<% }) %>
<% if (opt.sync_load) { %>
<img
src="<%= opt.img.replace('.webp', '.png') %>"
src="<%= _.assetsPrefix || '' %><%= opt.img.replace('.webp', '.png') %>"
alt="<%= opt.alt %>"
<% if (width) { %>
width="<%= width %>"
Expand Down
2 changes: 1 addition & 1 deletion template/pages/@/sections/stamps.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ul class="stamps">
<% opt.stamps.forEach(({ src, alt, link, ...dimensions }) => {
const { width, height } = _.tryImageSize(src, dimensions)
const imgHtml = `<img data-src="${src}" alt="${alt}" class="lozad fade"` +
const imgHtml = `<img data-src="${(_.assetsPrefix || '')}${src}" alt="${alt}" class="lozad fade"` +
(width ? ` data-preload width="${width}" height="${height}">` : '>')
%>
Expand Down
2 changes: 1 addition & 1 deletion template/pages/app/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const contacts = _.cms('contacts') || {}
const footer = _.cms('footer') || {}
const logo = _.settings.logo
? { url: _.settings.logo, alt: _.settings.name }
? { url: (_.assetsPrefix || '') + _.settings.logo, alt: _.settings.name }
: _.store.logo
%>

Expand Down

0 comments on commit 3995bef

Please sign in to comment.