Skip to content

Commit bdcc0c1

Browse files
authored
Merge pull request #37 from hw0lff/mastodon
Add mastodon icon-link and fediverse tags
2 parents 3d00046 + 78f6ecd commit bdcc0c1

6 files changed

Lines changed: 65 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ site demo [here](https://micahkepe.com/radion/).
4545
- [Defining Author(s) Per\-Page](#defining-authors-per-page)
4646
- [Favicon](#favicon)
4747
- [GitHub](#github)
48+
- [Fediverse and Mastodon](#fediverse-and-mastodon)
4849
- [Code Snippets](#code-snippets)
4950
- [Syntax Highlighting:](#syntax-highlighting)
5051
- [Enhanced Codeblocks (Clipboard Support and Language Tags)](#enhanced-codeblocks-clipboard-support-and-language-tags)
@@ -207,6 +208,25 @@ To enable a GitHub reference link in the header, set the following in your
207208
github = "https://github.com/your-github-link"
208209
```
209210

211+
### Fediverse and Mastodon
212+
213+
In your `config.toml` you can set options related to the Fediverse and
214+
explicitly Mastodon.
215+
216+
To enable author attribution, set the `extra.fediverse.creator` option to your
217+
account address. To enable website verification, set the
218+
`extra.fediverse.rel_me` option to a link to your profile.
219+
220+
Set the `extra.mastodon` field to a link to your Mastodon account to show a
221+
Mastodon logo with this link.
222+
223+
```toml
224+
[extra]
225+
fediverse.creator = "@username@my.instance.example.com"
226+
fediverse.rel_me = "https://my.instance.example.com/@username"
227+
mastodon = "https://my.instance.example.com/@username"
228+
```
229+
210230
### Code Snippets
211231

212232
#### Syntax Highlighting:

config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ index_format = "elasticlunr_json"
3636
[extra]
3737
author = "Micah Kepe"
3838
github = "https://github.com/micahkepe/radion"
39+
fediverse.creator = "@username@my.instance.example.com"
40+
fediverse.rel_me = "https://my.instance.example.com/@username"
41+
mastodon = "https://my.instance.example.com/@username"
3942
radion_menu = [
4043
{url = "$BASE_URL/", name = "Home"},
4144
{url = "$BASE_URL/categories", name = "Categories"},

content/configuration/index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,25 @@ To enable a GitHub reference link in the header, set the following in your
168168
github = "https://github.com/your-github-link"
169169
```
170170

171+
### Fediverse and Mastodon
172+
173+
In your `config.toml` you can set options related to the Fediverse and
174+
explicitly Mastodon.
175+
176+
To enable author attribution, set the `extra.fediverse.creator` option to your
177+
account address. To enable website verification, set the
178+
`extra.fediverse.rel_me` option to a link to your profile.
179+
180+
Set the `extra.mastodon` field to a link to your Mastodon account
181+
to show a Mastodon logo with this link.
182+
183+
```toml
184+
[extra]
185+
fediverse.creator = "@username@my.instance.example.com"
186+
fediverse.rel_me = "https://my.instance.example.com/@username"
187+
mastodon = "https://my.instance.example.com/@username"
188+
```
189+
171190
### Code Snippets
172191

173192
#### Syntax Highlighting:

static/icons/mastodon.svg

Lines changed: 3 additions & 0 deletions
Loading

templates/_base.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
/>
5656
<meta name="twitter:title" content="{% block twitter_title %}{{ title }}{% endblock twitter_title %}" />
5757

58+
<!-- Additional Fediverse Tags -->
59+
{% if config.extra.fediverse.creator %}
60+
<meta name="fediverse:creator" content="{{ config.extra.fediverse.creator }}" />
61+
{% endif %} {% if config.extra.fediverse.rel_me %}
62+
<link rel="me" href="{{ config.extra.fediverse.rel_me }}" />
63+
{% endif %}
64+
5865
<!-- Cover images -->
5966
{% set cover_image = config.base_url ~ "/icons/favicon/web-app-manifest-512x512.png" %}
6067
{% if page and page.extra.cover_image and page.assets %}

templates/macros/index_macros.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@
8181
class="social-icon"
8282
/>
8383
</a>
84+
{% endif %} {% if config.extra.mastodon %}
85+
<a
86+
href="{{ config.extra.mastodon }}"
87+
class="feed-icon"
88+
rel="noopener noreferrer"
89+
>
90+
<img
91+
src="{{ get_url(path='icons/mastodon.svg') }}"
92+
id="mastodon-icon"
93+
alt="Mastodon"
94+
class="social-icon"
95+
/>
96+
</a>
8497
{% endif %}
8598
</aside>
8699
</section>

0 commit comments

Comments
 (0)