Port Mastodon's hashtag stats thing to glitch-soc.
This doesn't change how hashtags are ordered, and doesn't add a trending
hashtags section, but it does change how hashtag searches are rendered,
displaying a trend line alongside each hashtag.
Upstream's implementation has been merged a while ago and is the preferred
way to set fields, as it is the only one compatible with upstream and is
more user-friendly.
This commit deletes the legacy glitch-soc FrontMatter functionality in order
to clean up the code and make it easier to maintain.
So far, glitch-soc used history.length to decide whether to call `goBack()` or
go to / in order to not leave the webUI. This made clicking the “Back” button
go to the “Getting started” column instead of going back in the browser's
history when such an action would leave the web UI, but also when:
- The WebUI is refreshed (F5)
- A tab is restored
- The history length reaches its maximum (e.g., 50 in Firefox)
This commit fixes these shortcomings by checking `window.history.state`.
Indeed, we only want to go back in the browser's history when the current
location has been reached from within the WebUI, which only happens via
`pushState` as far as I know. Since browser store the serialized state in
the browser history, this also survives page reload and session restoration.
flavours/glitch/util/initial_state is used in places where we want to
exhibit different behavior based on user preferences. This means that
it's used in places where no preference is defined, i.e. on an
unauthenticated access. All values exported from that module must
therefore expect that case; previously, the max chars value didn't.
Addresses #306.