1
1
Fork
You've already forked site
0

feat(micropub): add metadata to entry #129

Merged
robida merged 10 commits from add-metadata-micropub into main 2025年12月29日 21:58:05 +01:00
  • Add metadata to entries when they're created via Micropub.
  • Resolve author into h-cards when rendering entries.

Migration:

UPDATEmicroformats2SETcontent=json_set(content,'$.properties.url',COALESCE(json_extract(content,'$.properties.url'),json_extract(content,'$.properties.uid')),'$.properties.published',COALESCE(json_extract(content,'$.properties.published'),json_array(strftime('%Y-%m-%dT%H:%M:%SZ',created_at))),'$.properties.author',COALESCE(json_extract(content,'$.properties.author'),json_array(author)))WHEREauthor='https://robida.net'ANDjson_extract(content,'$.type[0]')='h-entry'AND(json_extract(content,'$.properties.url')ISNULLORjson_extract(content,'$.properties.published')ISNULLORjson_extract(content,'$.properties.author')ISNULL);-- Optionally: Backfill updated for entries that have been modified
UPDATEmicroformats2SETcontent=json_set(content,'$.properties.updated',json_array(strftime('%Y-%m-%dT%H:%M:%SZ',updated_at)))WHEREauthor='https://robida.net'ANDjson_extract(content,'$.type[0]')='h-entry'ANDupdated_atISNOTNULLANDupdated_at!=created_atANDjson_extract(content,'$.properties.updated')ISNULL;
- Add metadata to entries when they're created via Micropub. - Resolve `author` into h-cards when rendering entries. Migration: ```sql UPDATE microformats2 SET content = json_set( content, '$.properties.url', COALESCE( json_extract(content, '$.properties.url'), json_extract(content, '$.properties.uid') ), '$.properties.published', COALESCE( json_extract(content, '$.properties.published'), json_array(strftime('%Y-%m-%dT%H:%M:%SZ', created_at)) ), '$.properties.author', COALESCE( json_extract(content, '$.properties.author'), json_array(author) ) ) WHERE author = 'https://robida.net' AND json_extract(content, '$.type[0]') = 'h-entry' AND ( json_extract(content, '$.properties.url') IS NULL OR json_extract(content, '$.properties.published') IS NULL OR json_extract(content, '$.properties.author') IS NULL ); -- Optionally: Backfill updated for entries that have been modified UPDATE microformats2 SET content = json_set( content, '$.properties.updated', json_array(strftime('%Y-%m-%dT%H:%M:%SZ', updated_at)) ) WHERE author = 'https://robida.net' AND json_extract(content, '$.type[0]') = 'h-entry' AND updated_at IS NOT NULL AND updated_at != created_at AND json_extract(content, '$.properties.updated') IS NULL; ```
robida changed title from (削除) add-metadata-micropub (削除ここまで) to feat(micropub): add metadata to entry 2025年12月29日 21:22:19 +01:00
robida force-pushed add-metadata-micropub from 32f15020ad
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
to af8a9ee5bc
Some checks failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test Pipeline failed
2025年12月29日 21:36:40 +01:00
Compare
Fix merge
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
6356299a84
Small lint
Some checks are pending
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
4650b48247
Fix style for name with IPA
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
4386e9c807
robida deleted branch add-metadata-micropub 2025年12月29日 21:58:05 +01:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robida/site!129
Reference in a new issue
robida/site
No description provided.
Delete branch "add-metadata-micropub"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?