feat: mastodon-post web component

This commit is contained in:
Cory Dransfeldt 2024-02-19 11:19:38 -08:00
parent e0f6c26000
commit 6b65a517c5
No known key found for this signature in database
7 changed files with 64 additions and 7 deletions

View 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 -%}

View file

@ -29,5 +29,6 @@ schema: blog
</div>
</article>
</div>
{% render "partials/mastodon-post.liquid", postUrl: postUrl, linkPosts: linkPosts %}
{% render "partials/post-tags.liquid", tags: tags %}
{% render "partials/popular-posts.liquid", posts: collections.posts, analytics: analytics %}