Skip to content

Commit

Permalink
fix: SVG shortcut passing null to html
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdoc committed May 12, 2024
1 parent cf6c70c commit 8641f18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/_includes/blocks/header.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<a href="/" title="The Globe Church" class="w-[175px] h-[110px] top-[-3.2rem] uppercase font-bold no-underline fixed right-2 z-10 sm:w-fit sm:top-[-3.2rem] sm:right-4">
<h1 class="sr-only">The Globe Church</h1>
{% svgIcon "tgcLogoFilled", "w-full" %}
{% svgIcon "tgcLogoFilled", "w-full", "The Globe Church" %}
</a>

<div class="fixed left-0 top-0 sm:bottom-0 px-2 py-2 z-30 sm:bg-blue sm:p-4 sm:text-white sm:w-16">
Expand Down
4 changes: 2 additions & 2 deletions src/_utils/11ty.shortcodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ module.exports = {
});
},

svgIcon: function(name, cls = null, title = null) {
if (title !== null) {
svgIcon: function(name, cls = null, title = "") {
if (title !== "") {
title = `<title>${title}</title>`;
}
return `<svg class="${cls}">${title}<use xlink:href="/_assets/svgSprite.svg#svg-${name}"></use></svg>`;
Expand Down

0 comments on commit 8641f18

Please sign in to comment.