New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEV-16534: WebC Figure image refactor #885
Conversation
…figure supcomponent print outputs
<template webc:nokeep> | ||
<canvas-panel webc:if="isCanvas(id)" @attributes="attributes(id, image_dir).canvasPanel"></canvas-panel> | ||
<image-service webc:elseif="isImageService(id)" @attributes="attributes(id, image_dir).imageService"></image-service> | ||
<image-sequence webc:elseif="isSequence(id)" @attributes="attributes(id, image_dir).imageSequence"></image-sequence> | ||
<image-tag webc:else @attributes="attributes(id, image_dir).imageTag"></image-tag> | ||
</template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the template be written using a dynamic webc component, webc:is="component(id)"
, rather than a webc conditional statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently webc:is
does not support dynamic values; see 11ty/webc#143
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might add a comment on the implementation quirks, something like
<!---
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.
--->
Co-authored-by: matthew p hrudka <mphstudios@users.noreply.github.com>
This adds:
_components/quire-figure.webc
: defines a<figure>
with anid
and conditionally rendersfigureAudio
,figureTable
,figureVideo
, andfigureImageWebc
_components/figure-image.webc
: conditionally renders<canvas-panel>
,<image-sequence>
,<image-service>
, and<image-tag>
components based onmediaType
. Registered as an eleventy shortcode namedfigureImageWebc
_components/image-tag.webc
: renders a<img>
tag with alt textNote: Media embed links in video/audio figures are currently rendering in web output; these links should only show in print output. Image Sequences still need to be addressed as well -- see https://jira.getty.edu/browse/DEV-16542
@mphstudios I was originally planning on doing these figure image component webc refactors in isolation, but refactoring the
_plugins/shortcodes/figure.js
to renderquire-figure.webc
ended up being much simpler -- we can still use the JS components for video, audio, and table figures via@html="..."
. Interestingly enough, none of these actually need thequire-data
JSON since we can just use ourgetFigure(id)
filter -- I anticipate that will still be necessary / useful for refactoring the lightbox/modal.