Add post around archiving Firefish posts, as well as Draft tags for posts
This commit is contained in:
parent
4c5309dd17
commit
947e16ec50
@ -1,5 +1,7 @@
|
||||
const tags = require('./tags');
|
||||
const posts = require('./posts');
|
||||
|
||||
module.exports = function(eleventyConfig) {
|
||||
eleventyConfig.addPlugin(tags);
|
||||
eleventyConfig.addPlugin(posts);
|
||||
}
|
7
config/collections/posts.js
Normal file
7
config/collections/posts.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = function (eleventyConfig) {
|
||||
eleventyConfig.addCollection('posts',collectionApi =>
|
||||
collectionApi.getFilteredByTag("posts")
|
||||
.filter(p => process.env.DEBUG || !p.data.tags.includes("draft"))
|
||||
.filter(p => process.env.DEBUG || p.date < new Date())
|
||||
)
|
||||
}
|
@ -9,7 +9,7 @@ includePrism: true
|
||||
<div class="e-content stack-md">
|
||||
{{ content | safe }}
|
||||
</div>
|
||||
{% set filteredTags = tags | except("posts") %}
|
||||
{% set filteredTags = tags | except("posts") | except("draft") %}
|
||||
{% if filteredTags | length %}
|
||||
<section>
|
||||
<h2>Tags:</h2>
|
||||
|
30
src/blog/posts/2024/1/archiving-firefish-posts.md
Normal file
30
src/blog/posts/2024/1/archiving-firefish-posts.md
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
title: "New project: archive your Firefish posts"
|
||||
tags:
|
||||
- draft
|
||||
---
|
||||
|
||||
This project is heavily inspired by Zach Leatherman's [Tweetback](https://www.zachleat.com/web/tweetback/)], but instead of being for Twitter, it's for Firefish. I recently [moved away from using Firefish](/post/simplifying-things-for-2024), but I didn't want to remove the instance as then the individual posts would be inaccessible. While I don't think anything I wrote on that account is particularly impactful (unless someone's been cataloguing my commutes or something), I'd still like to make them accessible for posterity.
|
||||
|
||||
## My solution
|
||||
|
||||
So I built this tool: [Firefish Archiver](https://git.lewisdale.dev/lewis/firefish-archive). It uses Eleventy + the open Firefish API to retrieve every public note from the account, and then recreate it using the same URL structure. I've (tried) to make the resulting HTML as un-shit as possible, but it's still very much a work-in-progress.
|
||||
|
||||
Usage is pretty simple: add your user ID and Firefish host to the `src/_data/metadata.json` file, and then run the `npm build` command. The template then:
|
||||
|
||||
1. Fetches your profile information and recreates it
|
||||
2. Fetches all of the public posts and organises them into threads
|
||||
3. Creates a `/.well-known/webfinger` file pointing to whatever account you've redirected to
|
||||
|
||||
Then, you can upload the output in the `_site` directory to any location you'd like. The output is cached, so you shouldn't need to worry about the instance being deleted on subsequent rebuilds. The _intention_ for this is that it can replace the instance entirely as a static drop-in, for single-user instances, but it can also be used if you want to host a copy of the content from another instance.
|
||||
|
||||
## Things still to add
|
||||
|
||||
I've got plans to add a few extra details. Namely:
|
||||
|
||||
1. Content warnings
|
||||
2. Favourite & Renote counts
|
||||
3. Site search
|
||||
4. Improving the styling
|
||||
|
||||
Feedback on the project is always appreciated - you can send a webmention to this page, or drop me a message through any of [my socials][/links].
|
Loading…
Reference in New Issue
Block a user