Skip to content

Commit 80ef9ca

Browse files
committed
Add share button
1 parent 0808bbe commit 80ef9ca

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

assets/icons/share.svg

Lines changed: 1 addition & 0 deletions
Loading

themes/mastodon/layouts/_default/single.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
{{ define "content" }}
22
<article class="h-entry">
33
<header class="max-w-prose mx-auto relative">
4-
<div class="flex flex-wrap items-center gap-x-4 text-xs mb-8">
5-
<a href="/" class="inline-flex items-center font-bold text-blurple-600 hover:underline hover:text-blurple-500">{{ partial "svg.html" "arrow-small-left" }} Back</a>
4+
<div class="flex items-center justify-between text-xs mb-8">
5+
<div class="flex flex-wrap items-center gap-x-4">
6+
<a href="/" class="inline-flex items-center font-bold text-blurple-600 hover:underline hover:text-blurple-500">{{ partial "svg.html" "arrow-small-left" }} Back</a>
67

7-
<time class="text-gray-500 dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">
8-
{{ .Date.Format "Jan 2, 2006" }}
9-
</time>
8+
<time class="text-gray-500 dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">
9+
{{ .Date.Format "Jan 2, 2006" }}
10+
</time>
1011

11-
<div class="flex flex-wrap items-center gap-x-4">
12-
{{ range .Params.categories }}
13-
<a class="relative z-10 rounded-full bg-nightshade-50 text-nightshade-900 px-3 py-1.5 font-medium hover:text-nightshade-600 whitespace-nowrap" href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
14-
{{ end }}
12+
<div class="flex flex-wrap items-center gap-x-4">
13+
{{ range .Params.categories }}
14+
<a class="relative z-10 rounded-full bg-nightshade-50 text-nightshade-900 px-3 py-1.5 font-medium hover:text-nightshade-600 whitespace-nowrap" href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
15+
{{ end }}
16+
</div>
17+
</div>
18+
19+
<div class="flex items-center gap-x-2 text-gray-400">
20+
{{ partial "svg.html" "share" }}
21+
<a target="_blank" rel="noopener" href="https://share.joinmastodon.org/?text={{ .Permalink }}" class="inline-flex items-center gap-x-1 rounded-full bg-blurple-600 text-white px-3 py-1.5 font-bold hover:bg-blurple-500" aria-label="Share on Mastodon">
22+
Share on {{ partial "svg.html" "mastodon" }}
23+
</a>
1524
</div>
1625
</div>
1726

0 commit comments

Comments
 (0)