Closed palant closed 11 months ago
I now added shareOnMastodonFetchInstances
option to explicitly enable that request to download instances. By default, no request will happen and the list will simply stay empty. I added it to the English example configuration, you will need to add to Chinese configurations yourself.
I love fediverse! Can you provide an additional screencast of this feature to help me review?
This is the icon:
And this is the page that opens when it is clicked:
Here I clicked “Remember instance” before and it saved my Mastodon instance. Otherwise it wouldn’t be checked by default.
I just realized that I don’t remember where I got this Mastodon icon from (it has been used on my site for years). I’ll check that.
Oh, and here is what it looks like after clicking “Continue to Mastodon”:
Added one one commit. I didn’t realize that the other share icons have a hover effect, added it for the Mastodon icon as well.
I just realized that I don’t remember where I got this Mastodon icon from (it has been used on my site for years). I’ll check that.
It’s Font Awesome, just like all the other icons. So it’s all fine here.
I am somewhat undecided as to where to go from here. My original intent was adding more share icons for other Fediverse apps like KBin or Lemmy in subsequent pull requests. However, there are simply too many if you look at the projects supported by Share₂Fedi.
Now it is possible to have a universal share form. It would determine the kind of software running on the instance and create the appropriate link. It would make sense. Except: what should be the icon then?
There are icons for Fediverse and ActivityPub. These aren’t exactly well-known however.
I think that the best course of action would be adding both Mastodon and Fediverse icons, doing exactly the same thing. If you agree, I’ll change this pull request accordingly.
Ok, I’ve implemented this as a generic “Share on Fediverse” now. Notes:
.well-known/nodeinfo
usually doesn’t have CORS headers set.fedishare.html
is now at 160 KiB which I consider acceptable.components/fedishare.html
partial doing all the work, and the file under assets is minimal.What it looks like. Share icons:
The share form, this time without a saved instance:
Next step on Mastodon:
Next step on KBin:
Next step on Hubzilla:
Next step on Friendica:
All fixed:
shareOnMastodon
and shareOnFediverse
options. So it is possible to display either one icon and not only both of them.shareOnFediverseFetchInstances
into shareFetchFediverseInstances
– with two possible options to display icons, the relationship cannot be established via naming any more. Instead, I mentioned it in a comment.
It has been a while since I touched the theme, so I might have missed something @reuixiy.
This adds a “Share on Mastodon” button. That’s somewhat less trivial than usual because a Mastodon instance needs to be selected, requiring an intermediate page. The page I created is heavily inspired by Share₂Fedi but doesn’t require server-side support. Also, parameters are passed via
location.hash
rather than the query string, meaning that they won’t be visible in server logs (privacy).There is a request to
api.fediverse.observer
to populate the list of suggested instances. This request is happening at build time which a) might slow down the build process and b) might get outdated if the site is rarely updated. Nevertheless, I consider this solution better than a client-side request. Fediverse Observer doesn’t allow filtering the list other than by status, meaning that users would have to download 8 MB of data. With the filtering done by Hugo, it’s only 600 instances left (around 30 kB). Hugo can also be configured to cache this request so that it won’t be repeated unnecessarily.Passing a parameter to
head.html
partial via.Scratch
is very ugly but this was the only solution I could see in the short term.Metadata of the share page seems mostly fine, thanks to the index page being passed as context. If anything, a better page title would be an option.