-
Notifications
You must be signed in to change notification settings - Fork 311
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
Migrate linked figures in blog posts #3858
Comments
<figure>
s
@beechnut is this something you would like to take on or have someone else work on? |
@bpdesigns I'm unassigning myself so someone else can take this during this next increment. I'll still be up for helping / reviewing PRs. |
I tried working on this, and it was very difficult to set up as a shortcode. Here's what I've discovered, leaving this for posterity. When I tried to make a shortcode, my plan was to do something like this: // config/shortcodes/linkedFigure.js
const imageWithClass = require('./imageWithClass')
module.exports = async (src, alt) => {
return `<figure>
<a href="{{ ${ src } | url }}"> // use the URL filter to get the asset URL
${ await imageWithClass(src, '', alt) } // reuse this shortcode for the image part
</a>
</figure>`
} Things quickly went awry:
|
Many of the images in the blog are
<figure>
s surrounded by<a>
tags with links to the image being displayed. (example)#3855 will change
<img>
tags, but it's not in scope for that ticket to handle the links.Acceptance criteria (choose 1)
The text was updated successfully, but these errors were encountered: