Skip to content

Instantly share code, notes, and snippets.

@nanos
nanos / 1 - Mastodon Comments.md
Last active January 7, 2024 14:45
Mastodon Comments

Mastodon Comments

A simple, dependency-free script to add Mastodon-powered comments to your site. For details see Adding comments to your blog, powered by mastodon

Turn this HTML

<div id="comments"></div>
<script>
 addEventListener('DOMContentLoaded', (event) =&gt; window.loadComments('{mastodon}',document.getElementById('comments')));
@nanos
nanos / README.md
Last active December 9, 2022 16:51
Some custom CSS to collapse mastodon poll, favourite, and boost notifications

The CSS provided below will collapse your Mastodon notifications for polls that have ended, favourites and boosts to a single line.

The avatar and action buttons are also removed.

As a result your notificatios are far slimmer, and you can focus on the more interesting notifications, particularly mentions and replies.

You'll need to be Admin of your mastodon instance, though.

To install go to Preferences > Administration > Server settings. Change to the Appearance tab, and paste the CSS into the Custom CSS field.

@nanos
nanos / index.js
Created November 23, 2022 17:57
webfinger through CloudFlare Worker
/**
* 1) Create a worker with the below content, replacing your target account
* 2) Assign that worker to the .well-known/webfinger* route on your domain.
*/
// Change this to yor target account
const account = 'you@instance.social';
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request))