beeminder / blog

3 stars 2 forks source link

DRY up the titles between begin-magic in the source docs and posts.json #477

Open narthur opened 8 months ago

narthur commented 8 months ago
### Desiderata
- [x] Clarify the desired end state: titles in source docs or in posts.json
- [ ] Temporarily fail build if title mismatch between posts.json & etherpad
- [ ] Ask Danny which title to go with for any conflicts
- [ ] Entirely remove title field from posts.json
- [ ] Fail build if title ever specified in posts.json

Cognata

Verbata: DRY, titles of blog posts in two places,

narthur commented 8 months ago

@dreeves You mentioned here that moving away from using begin-magic to set post titles could be a future task. This would actually be quite easy for us to do since we already have the code to pull and parse the existing titles, so writing a script to take all those titles and add them to posts.json would be trivial. Can we get the go-ahead to do this?

dreeves commented 8 months ago

It's the other way around. The markdown rendering for etherpad (aka expost) needs the titles; they can't live in posts.json. DRYing this up means getting the titles out of posts.json.

As a sanity check, can we get the list of any titles that don't already match?

dreeves commented 8 months ago

Or break the build if they don't match -- that's a simple way to see which ones don't match and is a nice failsafe. Of course that failsafe will be moot when we DRY this up, but that's fine.

Relatedly, I may have changed my mind about every field needing to be explicit in posts.json. Candidate exceptions:

  1. title is fetched from the source doc's begin-magic (this gissue) and shouldn't be in posts.json at all
  2. disqus_id defaults to slug if not present
  3. redirects defaults to [] if not present
narthur commented 3 months ago

Decision: