Skip to content

Commit 60fb6b7

Browse files
Foxboronjelly
authored andcommitted
index: add support for MASTODON_LINK
Signed-off-by: Morten Linderud <[email protected]>
1 parent 248908d commit 60fb6b7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

main/context_processors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.conf import settings
2+
3+
4+
def mastodon_link(request):
5+
return {'MASTODON_LINK': getattr(settings, "MASTODON_LINK", "")}

settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@
225225
TIER0_MIRROR_DOMAIN = 'repos.archlinux.org'
226226
# TIER0_MIRROR_SECRET = ''
227227

228+
# Mastodon link to profile
229+
MASTODON_LINK = ''
230+
228231
# Import local settings
229232
try:
230233
from local_settings import * # noqa
@@ -246,6 +249,7 @@
246249
'django.template.context_processors.debug',
247250
'django.contrib.messages.context_processors.messages',
248251
'csp.context_processors.nonce',
252+
'main.context_processors.mastodon_link',
249253
],
250254
}
251255
}

templates/public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<link rel="alternate" type="application/rss+xml" title="Arch Linux News Updates" href="/feeds/news/" />
77
<link rel="alternate" type="application/rss+xml" title="Arch Linux Package Updates" href="/feeds/packages/" />
88
<script type="text/javascript" src="{% static "homepage.js" %}" defer></script>
9+
{% if MASTODON_LINK %}<link rel="me" href="{{MASTODON_LINK}}" title="Arch Linux Mastodon" />{% endif %}
910
{% endblock %}
1011

1112
{% block content_left %}

0 commit comments

Comments
 (0)