Sort json keys

This commit is contained in:
Nathan McCarty 2025-02-07 02:02:40 -05:00
parent 07a9b29c00
commit 9a87e7825a
6 changed files with 28 additions and 28 deletions

View file

@ -1,7 +1,7 @@
{
"title": "Stranger Systems",
"about-id": 2,
"base-url": "https://www.stranger.systems",
"placeholder-id": 0,
"tagline": "Making software better by making it weird",
"about-id": 2
"title": "Stranger Systems"
}

View file

@ -1,12 +1,12 @@
{
"source": "/dev/null",
"hidden": true,
"slugs": [
],
"posted-at": "2025-02-05T04:54:41.218425-05:00",
"edited-at": [
],
"tags": [
"hidden": true,
"placeholder": true,
"posted-at": "2025-02-05T04:54:41.218425-05:00",
"slugs": [
],
"placeholder": true
"source": "/dev/null",
"tags": [
]
}

View file

@ -1,12 +1,12 @@
{
"slugs": [
],
"source": "/home/nathan/Projects/Blog/projects/Markdown/MyNewBlog.md",
"edited-at": [
],
"hidden": false,
"markdown": true,
"posted-at": "2025-02-05T06:00:49.553777-05:00",
"slugs": [
],
"source": "/home/nathan/Projects/Blog/projects/Markdown/MyNewBlog.md",
"tags": [
"meta"
]

View file

@ -1,12 +1,12 @@
{
"markdown": true,
"tags": [
],
"source": "/home/nathan/Projects/Blog/projects/Markdown/About.md",
"slugs": [
],
"posted-at": "2025-02-05T06:01:16.693698-05:00",
"edited-at": [
],
"hidden": true
"hidden": true,
"markdown": true,
"posted-at": "2025-02-05T06:01:16.693698-05:00",
"slugs": [
],
"source": "/home/nathan/Projects/Blog/projects/Markdown/About.md",
"tags": [
]
}

View file

@ -1,13 +1,13 @@
{
"markdown": true,
"source": "/home/nathan/Projects/Blog/projects/Markdown/CryptoSuite.md",
"tags": [
"cryptography"
],
"edited-at": [
],
"hidden": false,
"markdown": true,
"posted-at": "2021-11-29T00:00:00Z",
"slugs": [
],
"hidden": false
"source": "/home/nathan/Projects/Blog/projects/Markdown/CryptoSuite.md",
"tags": [
"cryptography"
]
}

View file

@ -62,10 +62,10 @@ class PostDB {
mkdir $posts-dir unless $posts-dir.e;
# Write out metadata
# TODO: Track changes and only write changed files
$dir.add('meta.json').spurt: $!meta.to-json;
$dir.add('meta.json').spurt: $!meta.to-json(:sorted-keys);
# Write out posts (ids are the filename)
for %!posts.kv -> $key, $value {
$posts-dir.add("$key.json").spurt: $value.to-json;
$posts-dir.add("$key.json").spurt: $value.to-json(:sorted-keys);
}
}