diff --git a/packages/11ty/.eleventy.js b/packages/11ty/.eleventy.js index 4462f780e..b01bb620b 100644 --- a/packages/11ty/.eleventy.js +++ b/packages/11ty/.eleventy.js @@ -205,7 +205,12 @@ module.exports = function(eleventyConfig) { */ if (process.env.ELEVENTY_ENV === 'production') eleventyConfig.addPassthroughCopy(publicDir) eleventyConfig.addPassthroughCopy(`${inputDir}/_assets`) - eleventyConfig.addPassthroughCopy({ '_includes/web-components': '_assets/javascript' }) + eleventyConfig.addPassthroughCopy({ '_includes/web-components': '_assets/javascript/' }) + + /** + * Manually copy `is-land` module into client package + */ + eleventyConfig.addPassthroughCopy({ 'node_modules/@11ty/is-land/is-land.js': '_assets/javascript/is-land.js' }) /** * Watch the following additional files for changes and rerun server diff --git a/packages/11ty/_components/figure-image.webc b/packages/11ty/_components/figure-image.webc index bef034f19..98113a55b 100644 --- a/packages/11ty/_components/figure-image.webc +++ b/packages/11ty/_components/figure-image.webc @@ -3,13 +3,13 @@ Nota bene: `webc:is` does not support dynamic values (see 11ty/webc#143); use webc conditional statements and call the `attributes` function multiple times rather than using a fancier pattern of implementation. ---> - - - - + + + + diff --git a/packages/11ty/_components/image-tag.webc b/packages/11ty/_components/image-tag.webc index fbe6da64e..7384f6067 100644 --- a/packages/11ty/_components/image-tag.webc +++ b/packages/11ty/_components/image-tag.webc @@ -1,6 +1,6 @@ diff --git a/packages/11ty/_components/quire-figure.webc b/packages/11ty/_components/quire-figure.webc index 788bda1bc..1aef54e11 100644 --- a/packages/11ty/_components/quire-figure.webc +++ b/packages/11ty/_components/quire-figure.webc @@ -1,14 +1,17 @@ -
- - -
+ +
+ + +
+
+ diff --git a/packages/11ty/_layouts/base.11ty.js b/packages/11ty/_layouts/base.11ty.js index 34c26a56f..a26ad40e3 100644 --- a/packages/11ty/_layouts/base.11ty.js +++ b/packages/11ty/_layouts/base.11ty.js @@ -13,7 +13,14 @@ module.exports = async function(data) { const id = this.slugify(url) || path.parse(inputPath).name const pageId = `page-${id}` const figures = pageData.page.figures - const figuresJSON = figures ? JSON.stringify(figures) : '{}' + /** + * This is currently throwing an error about circular references in figure data + * Removing until we need quire-data written to page + * + * TODO: add `quire-data` when refactoring lightbox and modal to use webc + is-land + */ + // const figuresJSON = figures ? JSON.stringify(figures) : '{}' + const figuresJSON = '{}'; return html` diff --git a/packages/11ty/_plugins/components/index.js b/packages/11ty/_plugins/components/index.js index 7ff515522..61ed92cf3 100644 --- a/packages/11ty/_plugins/components/index.js +++ b/packages/11ty/_plugins/components/index.js @@ -28,5 +28,5 @@ module.exports = function(eleventyConfig, collections, options) { /** * Note: WebC attribute names must be all lowercase or snake_case */ - addWebcShortcode('figureImageWebc', 'figure-image', ['id', 'image_dir']) + addWebcShortcode('figureImageWebc', 'figure-image', ['id', 'image_dir', 'is_static', 'preset']) } diff --git a/packages/11ty/_plugins/components/shortcodeFactory.js b/packages/11ty/_plugins/components/shortcodeFactory.js index 851950860..7ce62d6e0 100644 --- a/packages/11ty/_plugins/components/shortcodeFactory.js +++ b/packages/11ty/_plugins/components/shortcodeFactory.js @@ -30,7 +30,7 @@ module.exports = function(eleventyConfig, collections) { * @param {String} tagName A template tag name for the component * @param {String} webcElementName A webc component tag name */ - addWebcShortcode: function(tagName, componentName, attributeNames) { + addWebcShortcode: function(tagName, componentName, attributeNames=[]) { eleventyConfig.addShortcode(tagName, async function(...args) { const renderTemplate = eleventyConfig.getFilter('renderTemplate') const renderedAttributes = attributeNames.map((name, index) => `${name}="${args[index]}"`).join(' ') diff --git a/packages/11ty/_plugins/shortcodes/contributors.js b/packages/11ty/_plugins/shortcodes/contributors.js index 1a13c62c1..21d178d42 100644 --- a/packages/11ty/_plugins/shortcodes/contributors.js +++ b/packages/11ty/_plugins/shortcodes/contributors.js @@ -36,7 +36,7 @@ module.exports = function (eleventyConfig) { const formats = ['bio', 'initials', 'name', 'name-title', 'name-title-block', 'string'] - if (!formats.includes(format)) { + if (format && !formats.includes(format)) { logger.error( `Unrecognized contributors shortcode format "${format}". Supported format values are: ${formats.join(', ')}` ) diff --git a/packages/11ty/_plugins/shortcodes/figure.js b/packages/11ty/_plugins/shortcodes/figure.js index 26ab50c66..5f4ef6a7f 100644 --- a/packages/11ty/_plugins/shortcodes/figure.js +++ b/packages/11ty/_plugins/shortcodes/figure.js @@ -39,6 +39,12 @@ module.exports = function (eleventyConfig) { this.page.figures ||= [] this.page.figures.push(figure) - return await quireFigure.call(this, classes, id, imageDir) + /** + * Render static versions of IIIF images inline + */ + const isStatic = true + const preset = 'responsive' + + return await quireFigure.call(this, classes, id, imageDir, isStatic, preset) } } diff --git a/packages/11ty/_plugins/shortcodes/figureGroup.js b/packages/11ty/_plugins/shortcodes/figureGroup.js index 90ef878d0..c462d5d6d 100755 --- a/packages/11ty/_plugins/shortcodes/figureGroup.js +++ b/packages/11ty/_plugins/shortcodes/figureGroup.js @@ -33,7 +33,7 @@ module.exports = function (eleventyConfig, { page }) { // logger.warn(`NoMediaType: One of the figures passed to the q-figures shortcode is missing the 'media_type' attribute. Figures in 'figures.yaml' must be have a 'media_type' attribute with a value of either "vimeo" or "youtube"`) // } - const classes = ['column', 'q-figure--group__item', `quire-grid--${columns}`] + const classes = ['column', 'q-figure--group__item'] const rows = Math.ceil(ids.length / columns) let figureTags = [] for (let i=0; i < rows; ++i) { @@ -42,7 +42,7 @@ module.exports = function (eleventyConfig, { page }) { for (let id of ids.slice(startIndex, columns + startIndex)) { row += await figure(eleventyConfig, { page }).bind(this)(id, classes) } - figureTags.push(`
${row}
`) + figureTags.push(`
${row}
`) } return oneLine` diff --git a/packages/11ty/_plugins/shortcodes/index.js b/packages/11ty/_plugins/shortcodes/index.js index 934eee9ec..91a6fe700 100644 --- a/packages/11ty/_plugins/shortcodes/index.js +++ b/packages/11ty/_plugins/shortcodes/index.js @@ -27,5 +27,5 @@ module.exports = function(eleventyConfig, collections, options) { /** * Note: WebC attribute names must be all lowercase or snake_case */ - addWebcShortcode('quireFigure', 'quire-figure', ['classes', 'id', 'image_dir']) + addWebcShortcode('quireFigure', 'quire-figure', ['classes', 'id', 'image_dir', 'is_static', 'preset']) } diff --git a/packages/11ty/package-lock.json b/packages/11ty/package-lock.json index fd25635be..39444ed39 100644 --- a/packages/11ty/package-lock.json +++ b/packages/11ty/package-lock.json @@ -23,7 +23,7 @@ "@11ty/eleventy-plugin-syntaxhighlight": "^4.2.0", "@11ty/eleventy-plugin-vite": "^4.0.0", "@11ty/eleventy-plugin-webc": "^0.11.1", - "@11ty/is-land": "^3.0.1", + "@11ty/is-land": "^3.0.2", "@iiif/parser": "^1.1.2", "@iiif/vault": "^0.9.22", "ajv": "^8.12.0", diff --git a/packages/11ty/package.json b/packages/11ty/package.json index 1c75fba18..88ce73ab0 100644 --- a/packages/11ty/package.json +++ b/packages/11ty/package.json @@ -59,7 +59,7 @@ "@11ty/eleventy-plugin-syntaxhighlight": "^4.2.0", "@11ty/eleventy-plugin-vite": "^4.0.0", "@11ty/eleventy-plugin-webc": "^0.11.1", - "@11ty/is-land": "^3.0.1", + "@11ty/is-land": "^3.0.2", "@iiif/parser": "^1.1.2", "@iiif/vault": "^0.9.22", "ajv": "^8.12.0",