added mastodon share

This commit is contained in:
Leon van Kammen 2026-09-01 17:38:19 +02:00
parent b90fe9ece4
commit 10a72ff713
5 changed files with 35 additions and 1 deletions

View file

@ -70,6 +70,10 @@ img.icon.rss{
width: 14px; width: 14px;
transform: translate(0,-4px); transform: translate(0,-4px);
} }
img.icon.mastodon{
width: 19px;
transform: translate(-4px,1px);
}
img.icon.invert, img.icon.invert,
img.icon.link, img.icon.link,
img.icon.play, img.icon.play,

4
src/img/mastodon.svg Normal file
View file

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="61.076954mm" height="65.47831mm" viewBox="0 0 216.4144 232.00976">
<path fill="#8888aa" d="M211.80734 139.0875c-3.18125 16.36625-28.4925 34.2775-57.5625 37.74875-15.15875 1.80875-30.08375 3.47125-45.99875 2.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125 0 2.53375.15625 4.94625.46875 7.2025 3.38375 25.68625 25.47 27.225 46.39125 27.9425 21.11625.7225 39.91875-5.20625 39.91875-5.20625l.8675 19.09s-14.77 7.93125-41.08125 9.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23234 213.82 1.40609 165.31125.20859 116.09125c-.365-14.61375-.14-28.39375-.14-39.91875 0-50.33 32.97625-65.0825 32.97625-65.0825C49.67234 3.45375 78.20359.2425 107.86484 0h.72875c29.66125.2425 58.21125 3.45375 74.8375 11.09 0 0 32.975 14.7525 32.975 65.0825 0 0 .41375 37.13375-4.59875 62.915"/>
<path fill="#000000" d="M177.50984 80.077v60.94125h-24.14375v-59.15c0-12.46875-5.24625-18.7975-15.74-18.7975-11.6025 0-17.4175 7.5075-17.4175 22.3525v32.37625H96.20734V85.42325c0-14.845-5.81625-22.3525-17.41875-22.3525-10.49375 0-15.74 6.32875-15.74 18.7975v59.15H38.90484V80.077c0-12.455 3.17125-22.3525 9.54125-29.675 6.56875-7.3225 15.17125-11.07625 25.85-11.07625 12.355 0 21.71125 4.74875 27.8975 14.2475l6.01375 10.08125 6.015-10.08125c6.185-9.49875 15.54125-14.2475 27.8975-14.2475 10.6775 0 19.28 3.75375 25.85 11.07625 6.36875 7.3225 9.54 17.22 9.54 29.675"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -8,6 +8,13 @@ ${header}
<center class="col3"> <center class="col3">
${opts.plugin_global_subtitle} ${opts.plugin_global_subtitle}
<a href="index.rss"><img src="img/rss.svg" class="icon rss"/></a> <a href="index.rss"><img src="img/rss.svg" class="icon rss"/></a>
]])
if opts.plugin_rssatom_mastodonshare == 'enabled' then
print([[
<a class="script" onclick="alert('To start receiving the (RSS) feed (of this page),\nwe will guide you to create an activation-post'); document.location.href = 'https://' + prompt('Your mastodon instance:', 'mastodon.social') + '/share?text=follow+this+XRForge+instance+]] .. util.getURL('/') .. [[index.rss+via+@birb@rss-parrot.net'"><img src="img/mastodon.svg" class="icon mastodon"/></a>
]])
end
print([[
</center> </center>
</div> </div>
<hr style="margin-top:0"/> <hr style="margin-top:0"/>
@ -16,8 +23,14 @@ end}
{if parent ~= nil and parent.parent ~= nil then {if parent ~= nil and parent.parent ~= nil then
print([[ print([[
<h2><span class="col1">//</span> ${parent.name} <a href="${req.url}.rss"><img src="img/rss.svg" class="icon rss"/></a></h2> <h2><span class="col1">//</span> ${parent.name} <a href="${req.url}.rss"><img src="img/rss.svg" class="icon rss"/></a>
]]) ]])
if opts.plugin_rssatom_mastodonshare == 'enabled' then
print([[
<a class="script" onclick="alert('To start receiving the (RSS) feed (of this page),\nwe will guide you to create an activation-post'); document.location.href = 'https://' + prompt('Your mastodon instance:', 'mastodon.social') + '/share?text=follow+this+XRForge+instance+]] .. util.getURL() .. [[.rss+via+@birb@rss-parrot.net'"><img src="img/mastodon.svg" class="icon mastodon"/></a>
]])
end
print('</h2>')
end} end}
<div class="grid"> <div class="grid">

View file

@ -6,6 +6,12 @@
<base href="${opts.baseurl}" /> <base href="${opts.baseurl}" />
<title>${opts.plugin_global_title}</title> <title>${opts.plugin_global_title}</title>
<link rel="stylesheet" href="css/xrforge.css"></link> <link rel="stylesheet" href="css/xrforge.css"></link>
<link
rel="alternate"
type="application/rss+xml"
title="${opts.plugin_global_title} feed ${app.host}"
href="${util.getURL('/')}index.rss"
/>
${opts.plugin_global_header_html} ${opts.plugin_global_header_html}
<noscript> <noscript>
{if isroot then {if isroot then

View file

@ -44,6 +44,13 @@ local plugin = {
default="homepage", default="homepage",
values={always='always',homepage='only homepage'} values={always='always',homepage='only homepage'}
}, },
{
key='app.opts.plugin_rssatom_mastodonshare',
title='Mastodon share',
info="Show <a href='https://mastodonshare.com' target='_blank'>mastodonshare.com</a> next to RSS-button",
default="enabled",
values={enabled='enabled',disabled='disabled'}
},
{ {
key='app.opts.plugin_rssatom_url_1', key='app.opts.plugin_rssatom_url_1',
title='RSS/Atom URL 1', title='RSS/Atom URL 1',