diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-12-24 22:32:49 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-12-24 22:32:49 -0300 |
commit | 454c3337b5fcd2f98b40dac0714d303cdd9fc1f6 (patch) | |
tree | fdf53bb50b119132b630e287bcc866e25d6b18f8 /ganarchy/templating | |
parent | adcef364d90c60b2fcb587257daf40a7e8446ddf (diff) |
Add Fedi-To integration
Diffstat (limited to 'ganarchy/templating')
-rw-r--r-- | ganarchy/templating/templates.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ganarchy/templating/templates.py b/ganarchy/templating/templates.py index 1574d7c..af9bf2e 100644 --- a/ganarchy/templating/templates.py +++ b/ganarchy/templating/templates.py @@ -59,7 +59,11 @@ def get_template_loader(): </ul> <p>Powered by <a href="https://ganarchy.autistic.space/">GAnarchy</a>. AGPLv3-licensed. <a href="https://cybre.tech/SoniEx2/ganarchy">Source Code</a>.</p> <p> + {% if ganarchy.fedito != 0 -%} + <a href="https://fedi-to.net/register?h={{ ganarchy.fedito }}&protocol=web%2Bganarchy">Register web+ganarchy: URI handler (via Fedi-To)</a> + {% else -%} <a href="{{ ganarchy.base_url|e }}" onclick="event.preventDefault(); navigator.registerProtocolHandler('web+ganarchy', this.href + '?url=%s', 'GAnarchy');">Register web+ganarchy: URI handler</a> + {% endif -%} (Makes navigating between GAnarchy instances easier). </p> </body> @@ -106,7 +110,7 @@ def get_template_loader(): </head> <body> <h1>{{ project_title|e }}</h1> - <p>Tracking <span id="project_commit"><a href="web+ganarchy:{{ project_commit }}">{{ project_commit }}</a></span></p> + <p>Tracking <span id="project_commit"><a href="https://fedi-to.net/go?h={{ ganarchy.fedito }}&target=web%2Bganarchy:{{ project_commit }}">{{ project_commit }}</a></span></p> <div id="project_body"><p>{{ project_body|e|replace("\n\n", "</p><p>") }}</p></div> <h2>Pinned repos</h2> <ul> @@ -123,7 +127,11 @@ def get_template_loader(): <p>Powered by <a href="https://ganarchy.autistic.space/">GAnarchy</a>. AGPLv3-licensed. <a href="https://cybre.tech/SoniEx2/ganarchy">Source Code</a>.</p> <p> <a href="{{ base_url|e }}">Main page</a>. + {% if ganarchy.fedito != 0 -%} + <a href="https://fedi-to.net/register?h={{ ganarchy.fedito }}&protocol=web%2Bganarchy">Register web+ganarchy: URI handler (via Fedi-To)</a> + {% else -%} <a href="{{ base_url|e }}" onclick="event.preventDefault(); navigator.registerProtocolHandler('web+ganarchy', this.href + '?url=%s', 'GAnarchy');">Register web+ganarchy: URI handler</a> + {% endif -%} (Makes navigating between GAnarchy instances easier). </p> </body> |