chore: move early return
This commit is contained in:
parent
1bec07756c
commit
cb49bb0ab5
1 changed files with 1 additions and 2 deletions
|
@ -140,14 +140,13 @@ module.exports = function (eleventyConfig) {
|
||||||
|
|
||||||
// image shortcode
|
// image shortcode
|
||||||
eleventyConfig.addShortcode('image', async function (src, alt, css, sizes, loading) {
|
eleventyConfig.addShortcode('image', async function (src, alt, css, sizes, loading) {
|
||||||
|
if (!src) return
|
||||||
let metadata = await Image(src, {
|
let metadata = await Image(src, {
|
||||||
widths: [75, 150, 300, 600],
|
widths: [75, 150, 300, 600],
|
||||||
formats: ['webp'],
|
formats: ['webp'],
|
||||||
urlPath: '/assets/img/cache/',
|
urlPath: '/assets/img/cache/',
|
||||||
outputDir: './_site/assets/img/cache/',
|
outputDir: './_site/assets/img/cache/',
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!src) return
|
|
||||||
|
|
||||||
let imageAttributes = {
|
let imageAttributes = {
|
||||||
class: css,
|
class: css,
|
||||||
|
|
Reference in a new issue