A simple little blog that pulls posts from your PDS, using the pub.leaflet.document lexicon. Uses Redis to keep them
cached for a bit, in case you're popular and don't want to be constantly polling your PDS.
This blog now uses Leaflet, a block-based document format for ATProtocol. Instead of simple markdown content, posts are composed of structured blocks that support rich formatting and embedded content.
- Text blocks with rich text formatting (bold, italic, strikethrough, code, links)
- Header blocks (levels 1-6) with automatic styling
- Image blocks with aspect ratios and alt text
- Blockquote blocks for quoted content
- Code blocks for syntax highlighting
- Website cards with preview images and metadata
- Embedded Bluesky posts using the official embed widget
- Horizontal rules for visual separation
Images are served via Bluesky's CDN with proper URLs constructed from the DID and blob reference:
https://cdn.bsky.app/img/feed_fullsize/plain/{did}/{blobRef}@jpeg
Just a few things are needed in your .env file.
ATP_SERVICE=https://pds.haileyok.com/
ATP_IDENTIFIER=haileyok.com
ATP_DID=did:plc:oisofpd7lj26yvgiivf3lxsiATP_SERVICEis the URL of your PDS. It's probably hosted by Bluesky. Find it at internect.info.ATP_IDENTIFIERis your handle. It's used to know which repo to get records from.ATP_DIDis...your DID. Again, find it at internect.info. Used to get your Bluesky profile (I use this just to get the already-hosted copy of your profile picture. You could rewrite this if you wanted to, would be faster too).
You also need to have Redis running. I didn't bother adding configuration for it, so if you want to change where it's
hosted at check src/redis/redis.ts.
# macos
brew install redis
brew services start redis
# ubuntu
sudo apt-get install redis-server
sudo systemctl start redis
# centos
sudo yum install redis
sudo systemctl start redisJust run the vite server, you know, like usual?
yarn run dev
Make sure you have dotenv-cli installed.
npm install -g dotenv-cliThen build and serve.
yarn build
yarn start