Rename paired shortcode for image figure elment

This commit is contained in:
Helen Chong 2024-05-09 22:56:31 +08:00
parent 0fcc266dd0
commit c0e26d00a2
4 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@
<subtitle>Leilukin&#39;s personal website.</subtitle>
<link href="https://leilukin.neocities.org/feed.xml" rel="self"/>
<link href="https://leilukin.neocities.org"/>
<updated>2024-05-09T13:40:56Z</updated>
<updated>2024-05-09T14:54:24Z</updated>
<id>https://leilukin.neocities.org</id>
<author>
<name>Leilukin</name>

View File

@ -80,8 +80,8 @@ module.exports = function (eleventyConfig) {
return `<${el}${classMarkup}>${content}</${el}>`;
});
// Paired shortcode: figure element with figcaption
eleventyConfig.addPairedShortcode('figure', (caption, img, alt=caption) => {
// Paired shortcode: image figure and figcaption
eleventyConfig.addPairedShortcode('imgFigure', (caption, img, alt=caption) => {
const figcaption = markdownLibrary.renderInline(caption);
return `<figure>
<img src="${img}" alt="${alt}">

View File

@ -1,7 +1,7 @@
{% macro myASEPlaylist(intro) %}
{% figure "/assets/projects/playlists/My-Dear-Summer-Lover-cover.png", "Cover image of A Summers End fanmix 'My Dear Summer Lover: A Sam x Michelle Fanmix'" %}
{% imgFigure "/assets/projects/playlists/My-Dear-Summer-Lover-cover.png", "Cover image of A Summers End fanmix 'My Dear Summer Lover: A Sam x Michelle Fanmix'" %}
[Image description: Sam and Michelle from A Summers End almost kisses, with a play symbol and text on the top left corner, and the text "My Dear Summer Lover: A Sam x Michelle Fanmix" in a digital style font in front.]
{% endfigure %}
{% endimgFigure %}
{{ intro }} [{% cite "A Summers End — Hong Kong 1986" %}](https://www.asummersend.com/home){target="_blank"}, dedicated to Sam and Michelles love story.

View File

@ -7,9 +7,9 @@ categories: ["anti harry potter", "anti jk rowling"]
toc: true
---
{% figure "/assets/banners/harry-potter-free-site.png", "An anime girl crossing arms with a sidelong look and a Harry Potter-free message" %}
{% imgFigure "/assets/banners/harry-potter-free-site.png", "An anime girl crossing arms with a sidelong look and a Harry Potter-free message" %}
This site is Harry Potter free. Lookin [<i>sic</i>] for it? Leave.
{% endfigure %}
{% endimgFigure %}
(Credit to Tumblr user [comradesaucegay](https://comradesaucegay.tumblr.com/post/621403039459426304){target="_blank"} for this Harry Potter-free website banner){.center-text}