From 270a6d0dc04198f9135be4955fd124720ab536bb Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 26 Jan 2025 18:49:25 -0400 Subject: content: genreateSocialEmbed: use absoluteTo --- src/content/dependencies/generateSocialEmbed.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateSocialEmbed.js b/src/content/dependencies/generateSocialEmbed.js index 115dc262..513ea518 100644 --- a/src/content/dependencies/generateSocialEmbed.js +++ b/src/content/dependencies/generateSocialEmbed.js @@ -1,7 +1,5 @@ -import {getOrigin} from '#urls'; - export default { - extraDependencies: ['html', 'language', 'urls', 'wikiData'], + extraDependencies: ['absoluteTo', 'html', 'language', 'wikiData'], sprawl({wikiInfo}) { return { @@ -28,7 +26,7 @@ export default { imagePath: {validate: v => v.strictArrayOf(v.isString)}, }, - generate(data, slots, {html, language, urls}) { + generate(data, slots, {absoluteTo, html, language}) { switch (slots.mode) { case 'html': return html.tags([ @@ -44,19 +42,7 @@ export default { slots.imagePath && html.tag('meta', { property: 'og:image', - content: - (() => { - const toResult = - urls - .from('shared.root') - .to(...slots.imagePath); - - if (getOrigin(toResult)) { - return toResult; - } else { - return '/' + toResult; - } - })(), + content: absoluteTo(...slots.imagePath), }), ]); -- cgit 1.3.0-6-gf8a5