@@ -136,29 +136,25 @@ module.exports = function(eleventyConfig) {
136136
137137 // Copy button shortcode
138138 eleventyConfig . addLiquidShortcode ( "copybutton" , function ( name ) {
139- var checkmarkIcon = Icons [ "Checkmark" ] ;
140- var copyIcon = Icons [ "Copy" ] ;
141139 var tooltipId = "tooltip-" + ( name || Math . floor ( Math . random ( ) * 1000 ) ) ;
142140
143- var output = '' ;
144- output += '<button'
145- output += ' class="s-btn s-btn__muted s-btn__icon ps-absolute t8 r8"' ;
146- output += ' data-action="clipboard#copy"' ;
147- output += ' data-s-tooltip-placement="top"' ;
148- output += ' data-controller="s-tooltip"' ;
149- output += ' aria-describedby="' + tooltipId + '"' ;
150- output += '>' ;
151- output += '<span class="d-none" data-show-on-copy>' + checkmarkIcon + '</span>' ;
152- output += '<span data-hide-on-copy>' + copyIcon + '</span>' ;
153- output += '</button>'
154- output += '<div class="s-popover s-popover__tooltip"' ;
155- output += ' id="' + tooltipId + '"' ;
156- output += ' role="tooltip"' ;
157- output += ' aria-hidden="true">' ;
158- output += '<div class="s-popover--arrow"></div>' ;
159- output += '<span class="d-none" data-show-on-copy>Copied</span>' ;
160- output += '<span data-hide-on-copy>Copy</span>' ;
161- output += '</div>' ;
141+ var output = `<button
142+ class="s-btn s-btn__muted s-btn__icon ps-absolute t8 r8"
143+ data-action="clipboard#copy"
144+ data-s-tooltip-placement="top"
145+ data-controller="s-tooltip"
146+ aria-describedby="${ tooltipId } ">
147+ <span class="d-none" data-show-on-copy>${ Icons [ "Checkmark" ] } </span>
148+ <span data-hide-on-copy>${ Icons [ "Copy" ] } </span>
149+ </button>
150+ <div class="s-popover s-popover__tooltip"
151+ id="${ tooltipId } "
152+ role="tooltip"
153+ aria-hidden="true">
154+ <div class="s-popover--arrow"></div>
155+ <span class="d-none" data-show-on-copy>Copied</span>
156+ <span data-hide-on-copy>Copy</span>
157+ </div>` ;
162158
163159 return output ;
164160 } ) ;
0 commit comments