diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-26 18:49:25 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-26 18:49:25 -0400 |
commit | 270a6d0dc04198f9135be4955fd124720ab536bb (patch) | |
tree | a6faf8015f1c8dfa6af2a501135c3db7b0381e01 /src | |
parent | 689d49f28a258a985e2ce7ec9c2d3a876a0845d0 (diff) |
content: genreateSocialEmbed: use absoluteTo
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateSocialEmbed.js | 20 |
1 files changed, 3 insertions, 17 deletions
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), }), ]); |