Compare commits

..

2 Commits

Author SHA1 Message Date
Helen Chong bc4efca419 Add image description to my bee avatar 2024-07-31 00:03:55 +08:00
Helen Chong 0c7462ea48 Add class name parameter to image figures 2024-07-31 00:03:46 +08:00
2 changed files with 16 additions and 3 deletions

View File

@ -21,9 +21,12 @@ export default function(eleventyConfig) {
});
// Image figure and figcaption
eleventyConfig.addPairedShortcode('imgFigure', (caption, img, alt=caption, enableLazyLoading=true) => {
eleventyConfig.addPairedShortcode('imgFigure', (
caption, img, alt=caption, className, enableLazyLoading=true
) => {
const classMarkup = className ? ` class="${className}"` : "";
const figcaption = markdownLibrary.renderInline(caption);
return `<figure>
return `<figure${classMarkup}>
<img src="${img}" alt="${alt}"${enableLazyLoading ? ' loading="lazy"' : ''}>
<figcaption>${figcaption}</figcaption>
</figure>`;

View File

@ -34,7 +34,17 @@ More information about this site can be found on the following pages:
{% container "article", "content__section" %}
## The Webmaster
![Avatar of a drawing of Leilukin bee](/assets/leilukin/leilukin-bee.avif){loading="lazy"}{style="border-radius: 50%; width: 15rem; margin: 0.5em auto;"}
{% imgFigure "/assets/leilukin/leilukin-bee.avif", "Leilukin bee avatar", "avatar" %}
[Image description: Digital illustration of a bee wearing red glasses with oval-shaped body and wings on a light green background. Leilukin's signature is at the bottom right of the bee. Description ends]
{% endimgFigure %}
{%- css %}
.avatar img {
border-radius: 50%;
width: 15rem;
margin: 0.5em auto;
}
{% endcss %}
You can call me {{ sitemeta.siteAuthor.name }}. I am a Malaysian Chinese, queer, non-binary lesbian born in the early 90s. My pronouns are they/them and she/her in English, [他]{lang="zh"} and [她]{lang="zh"} in Chinese.