local function ensureHtmlDeps()
quarto.doc.addHtmlDependency({
name = 'social-share',
version = '0.1.0',
stylesheets = {
'social-share.css',
'_extensions/quarto-ext/fontawesome/assets/css/all.css'
}
})
end
function Meta(m)
ensureHtmlDeps()
local share_start = '
'
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
share_text = share_text .. share_end
quarto.doc.includeText("after-body", share_text)
end