local function ensureHtmlDeps()
quarto.doc.addHtmlDependency({
name = 'social-share',
version = '1.0.0',
stylesheets = {
'social-share.css',
'_extensions/quarto-ext/fontawesome/assets/css/all.min.css'
}
})
end
function Meta(m)
ensureHtmlDeps()
local share_start = '
'
if m.share.divclass then
local divclass = pandoc.utils.stringify(m.share.divclass)
share_start = '
'
end
local share_end = '
'
local share_text = share_start
local share_url = pandoc.utils.stringify(m.share.permalink)
if m.share.description ~= nil then
post_title = pandoc.utils.stringify(m.share.description)
else
post_title = pandoc.utils.stringify(m.title)
end
if m.share.twitter then
share_text = share_text ..
''
end
if m.share.linkedin then
share_text = share_text ..
'
'
end
if m.share.email then
share_text = share_text ..
'
'
end
if m.share.facebook then
share_text = share_text ..
'
'
end
if m.share.reddit then
share_text = share_text ..
'
'
end
if m.share.stumble then
share_text = share_text ..
'
'
end
if m.share.tumblr then
share_text = share_text ..
'
'
end
if m.share.mastodon then
share_text = share_text ..
'
'
end
if m.share.bsky then
share_text = share_text ..
'
'
end
share_text = share_text .. share_end
if m.share.location then
quarto.doc.includeText(pandoc.utils.stringify(m.share.location), share_text)
else
quarto.doc.includeText("after-body", share_text)
end
end