feat: mastodon-post web component
This commit is contained in:
parent
e0f6c26000
commit
6b65a517c5
7 changed files with 64 additions and 7 deletions
26
src/_includes/partials/mastodon-post.liquid
Normal file
26
src/_includes/partials/mastodon-post.liquid
Normal file
|
@ -0,0 +1,26 @@
|
|||
{%- assign shareLink = postUrl | findPost: linkPosts -%}
|
||||
{%- if shareLink %}
|
||||
{% capture css %}
|
||||
{% render "../../assets/styles/widgets/mastodon-post.css" %}
|
||||
{% endcapture %}
|
||||
<style>{{ css }}</style>
|
||||
<script type="module" src="/assets/scripts/mastodon-post.js"></script>
|
||||
<template id="mastodon-post-template">
|
||||
<div class="mastodon-post-wrapper">
|
||||
<blockquote data-key="content"></blockquote>
|
||||
<dl>
|
||||
<dt>{% tablericon "refresh" "Reposts" %}</dt>
|
||||
<dd data-key="reblogs_count"></dd>
|
||||
<dt>{% tablericon "message-circle" "Replies" %}</dt>
|
||||
<dd data-key="replies_count"></dd>
|
||||
<dt>{% tablericon "star" "Favorites" %}</dt>
|
||||
<dd data-key="favourites_count"></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</template>
|
||||
<mastodon-post>
|
||||
<a href="{{ shareLink }}">
|
||||
Discuss on Mastodon
|
||||
</a>
|
||||
</mastodon-post>
|
||||
{% endif -%}
|
Reference in a new issue