A CLI for publishing standard.site documents to ATProto sequoia.pub

Add Support for Multiple Publications #11

Open stevedylan.dev
Open opened by stevedylan.dev

Problem #

Right now Sequoia only works with multiple publications if they are in different repos. You can't have multiple publications for the same site since the config is limited to just one publisher record.

Proposed Solution #

Follow a similar path that's used in credentials where if there is multiple publications in the config, prompt the user with a choice, or bypass using a flag / ENV variable. Implementation must have backwards compatibility and be able to work from the old config format and the new one.

Existing configs continue to work unchanged:

 {
   "siteUrl": "https://example.com",
   "contentDir": "./blog",
   "publicationUri": "at://did:plc:.../site.standard.publication/abc123"
 }

New multi-publication config:

 {
   "siteUrl": "https://example.com",
   "defaultPublication": "blog",
   "publications": {
     "blog": {
       "contentDir": "./blog",
       "publicationUri": "at://...",
       "pathPrefix": "/posts"
     },
     "podcast": {
       "contentDir": "./episodes",
       "publicationUri": "at://...",
       "pathPrefix": "/podcast",
       "frontmatter": { "title": "episodeTitle" }
     }
   }
 }

This will also require updating how .sequoia-state.json is created, read, and updated. Must also be backwards compatible.

Might be easier to manage if publications was an array keyed on, probably, publicationUri. That's intended to be immutable (at least without the CID) while a contentDir, pathPrefix, etc., might change.

Good call!

Hello, I'd like to second the request for this to accommodate multiple feeds please?

Use case: I've got two main post feeds on my (Astro) site - a blog feed and a notes(/too-long-for-Bsky) feed. I am also mainly an artist, and my coding ability is largely limited to HTML, CSS, and copy-pasting anything else in various places until it works. 😃

Sequoia would be my ideal solution, if it could create/manage multiple feeds...

As an alternative/workaround, I've tried setting up both feeds as one site.standard.publication too, by moving both /blog and /notes under /src/content/posts. However, that creates a separate issue: because the default pathPrefix value is /posts, it amends all urls to be eg. https://my-site.com/posts/blog/entry etc when the actual file path is https://my-site.com/blog/entry (ie. no /posts).

Fwiw I currently have the two feeds validated using the following file structure, which does resolve:

└── my-project/
    └── public/
        └── .well-known/
            ├── site.standard.publication/
            │   ├── blog (contains at://)
            │   └── notes (contains at://)
            └── atproto-did

Hoping someone with more coding know-how than me (read: anybody, really) might take pity and be able to make this workable, please?

Find myself wanting this as well while messing with Hugo. I have a section for writing/blog posts, a section for scrappy notes, a section for bookmarks. I would love to be able to put more than just the blog section on my publication.

Sign up or Sign in to add to the discussion.