posts/This post was published from a git repository and here's how I did it.md
···3131[goat](https://github.com/bluesky-social/goat) is a CLI tool for interacting with AT Protocol. Using goat, we can do everything we will need for this project: listing records for an account, querying records from a specific collection, as well as querying, updating, or deleting specific records.
323233333434-Running it as part of CI is also really straightforward, I was pleasantly surprised to find out. It was a lot easier than I expected to get goat to authenticate with my PDS and [make a post on BSky](https://bsky.app/profile/m1emi1em.dev/post/3lwenaigagl2b) when I did a [test push to main on a repo](https://tangled.sh/@m1emi1em.dev/test-repo-please-ignore/pipelines/760/workflow/build.yml).
3434+Running it as part of CI is also really straightforward, I was pleasantly surprised to find out. It was a lot easier than I expected to get goat to authenticate with my PDS and [make a post on bsky](https://bsky.app/profile/m1emi1em.dev/post/3lwenaigagl2b) when I did a [test push to main on a repo](https://tangled.sh/@m1emi1em.dev/test-repo-please-ignore/pipelines/760/workflow/build.yml).
353536363737-Making a record for a blog post on WhiteWind with goat is slightly more involved than a BSky post. But it's just a matter of making a JSON file and feeding that to goat so it's still very easy.
3737+Making a record for a blog post on WhiteWind with goat is slightly more involved than a bsky post. But it's just a matter of making a JSON file and feeding that to goat so it's still very easy.
383839394040# Defining _exactly_ what I want to do
···5252# rkeys
535354545555-Record keys, or rkeys, are used to reference a specific record in a collection in a repository on a PDS. They are most commonly TIDs generated at the time the record was created - this is what BSky uses for most (all?) of their records.
5555+Record keys, or rkeys, are used to reference a specific record in a collection in a repository on a PDS. They are most commonly TIDs generated at the time the record was created - this is what bsky uses for (almost) all of their records.
565657575858My idea for tracking which records correspond to which files in the git repo was: write my own records in my own, separate collection on my PDS that contained the local file path to a source `.md` file using the same rkey as the WhiteWind blog record created from that file. An example of one of these records be viewed through PDSls [here](https://pdsls.dev/at://did:plc:4ijrxutxndrcbmwd2bzchsum/dev.m1emi1em.blog.postRef/3lwjxlkcurs4i).
···6161WhiteWind, at least at the time of writing, doesn't do any validation when getting stuff from a user's PDS that a record has a valid TID as an rkey like [their lexicon would imply](https://github.com/whtwnd/whitewind-blog/blob/main/lexicons/com/whtwnd/blog/entry.json#L8). So it's totally possible to just create a post with anything that's a valid rkey, but that seems sketchy to rely on and would break if WhiteWind ever actually validated that. Which meant that, if I didn't want to rely on behavior that shouldn't even work in the first place, I had to figure out TIDs.
626263636464-Fortunately TIDs are relatively straightforward, and even more thankfully when I was posting occasionally on BSky throughout the process of writing a script to do all of this, @zed.earth pointed me in the direction of [his own TID library for Clojure](https://github.com/BlushSocial/atproto-tid) which wasn't too difficult to adapt into what I ended up writing to glue all of this together.
6464+Fortunately TIDs are relatively straightforward, and even more thankfully when I was posting occasionally on bsky throughout the process of writing a script to do all of this, [@zed.earth](https://bsky.app/profile/zed.earth) pointed me in the direction of [his own TID library for Clojure](https://github.com/BlushSocial/atproto-tid) which wasn't too difficult to adapt into what I ended up writing to glue all of this together.
656566666767# Clojure?
···929293939494I'd also like to refactor and rewrite my script at some point to make it easy for others to use to also publish to WhiteWind from a git repo if they wanted to. There's also a few other things I'm interested in figuring out and adding to it as well:
9595-- Sharing a new post on BSky on post creation. This is super doable.
9595+- Sharing a new post on bsky on post creation. This is super doable.
9696- Figuring out a better way to handle post titles and post visibility. Right now the script just makes a post title by trimming the `.md` from the end of the filename and is also hardcoded to create the record with a public visibility. Something like Obsidian-style YAML frontmatter to specify a post title and visibility seems like a good solution? But I haven't thought too hard on how to best do this.
9797- WhiteWind supports embedding images into posts via blobs on a post's record. What I have right now does not account for this or do anything to allow it. It would be nice to have this.
9898