feat: post share button
This commit is contained in:
parent
6ca5bdba41
commit
1690b368fc
8 changed files with 73 additions and 13 deletions
|
@ -37,7 +37,8 @@
|
|||
'lazy'
|
||||
{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
<img src="{{ item.image }}" alt="{{ alt }}" loading="{{ loadingStrategy }}" />
|
||||
<!-- <img src="{{ item.image }}" alt="{{ alt }}" loading="{{ loadingStrategy }}" /> -->
|
||||
{{ item.image}}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
|
23
src/_includes/partials/share-button.liquid
Normal file
23
src/_includes/partials/share-button.liquid
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% capture css %}
|
||||
{% render "../../assets/styles/widgets/share-button.css" %}
|
||||
{% endcapture %}
|
||||
<style>{{ css }}</style>
|
||||
<script type="module" src="/assets/scripts/share-button.js"></script>
|
||||
<share-button>
|
||||
<button class="icon--small icon--center__vertical">{% tablericon "share" "Share" %}</button>
|
||||
<label>
|
||||
Share this page
|
||||
<input
|
||||
type="url"
|
||||
readonly
|
||||
value="{{ url }}"
|
||||
onclick="this.select()"
|
||||
/>
|
||||
</label>
|
||||
</share-button>
|
||||
<style>
|
||||
share-button:not(:defined) button,
|
||||
share-button:defined label {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
|
@ -14,7 +14,8 @@ schema: blog
|
|||
<h2 class="p-name" data-pagefind-meta="title">{{ title }}</h2>
|
||||
<span class="p-author h-card hidden">{{ meta.author }}</span>
|
||||
<div class="flex--centered">
|
||||
<time class="dt-published" datetime="{{ date }}">{{ date | readableDate }}</time>
|
||||
<time class="dt-published" datetime="{{ date }}">{{ date | readableDate }} • </time>
|
||||
{% render "partials/share-button.liquid", url:postUrl %}
|
||||
</div>
|
||||
<div class="p-summary hidden">{{ post_excerpt }}</div>
|
||||
<div class="e-content">
|
||||
|
|
Reference in a new issue