Sort json keys
This commit is contained in:
parent
07a9b29c00
commit
9a87e7825a
6 changed files with 28 additions and 28 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"title": "Stranger Systems",
|
"about-id": 2,
|
||||||
"base-url": "https://www.stranger.systems",
|
"base-url": "https://www.stranger.systems",
|
||||||
"placeholder-id": 0,
|
"placeholder-id": 0,
|
||||||
"tagline": "Making software better by making it weird",
|
"tagline": "Making software better by making it weird",
|
||||||
"about-id": 2
|
"title": "Stranger Systems"
|
||||||
}
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"source": "/dev/null",
|
|
||||||
"hidden": true,
|
|
||||||
"slugs": [
|
|
||||||
],
|
|
||||||
"posted-at": "2025-02-05T04:54:41.218425-05:00",
|
|
||||||
"edited-at": [
|
"edited-at": [
|
||||||
],
|
],
|
||||||
"tags": [
|
"hidden": true,
|
||||||
|
"placeholder": true,
|
||||||
|
"posted-at": "2025-02-05T04:54:41.218425-05:00",
|
||||||
|
"slugs": [
|
||||||
],
|
],
|
||||||
"placeholder": true
|
"source": "/dev/null",
|
||||||
|
"tags": [
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"slugs": [
|
|
||||||
],
|
|
||||||
"source": "/home/nathan/Projects/Blog/projects/Markdown/MyNewBlog.md",
|
|
||||||
"edited-at": [
|
"edited-at": [
|
||||||
],
|
],
|
||||||
"hidden": false,
|
"hidden": false,
|
||||||
"markdown": true,
|
"markdown": true,
|
||||||
"posted-at": "2025-02-05T06:00:49.553777-05:00",
|
"posted-at": "2025-02-05T06:00:49.553777-05:00",
|
||||||
|
"slugs": [
|
||||||
|
],
|
||||||
|
"source": "/home/nathan/Projects/Blog/projects/Markdown/MyNewBlog.md",
|
||||||
"tags": [
|
"tags": [
|
||||||
"meta"
|
"meta"
|
||||||
]
|
]
|
||||||
|
|
|
@ -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": [
|
"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": [
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"markdown": true,
|
|
||||||
"source": "/home/nathan/Projects/Blog/projects/Markdown/CryptoSuite.md",
|
|
||||||
"tags": [
|
|
||||||
"cryptography"
|
|
||||||
],
|
|
||||||
"edited-at": [
|
"edited-at": [
|
||||||
],
|
],
|
||||||
|
"hidden": false,
|
||||||
|
"markdown": true,
|
||||||
"posted-at": "2021-11-29T00:00:00Z",
|
"posted-at": "2021-11-29T00:00:00Z",
|
||||||
"slugs": [
|
"slugs": [
|
||||||
],
|
],
|
||||||
"hidden": false
|
"source": "/home/nathan/Projects/Blog/projects/Markdown/CryptoSuite.md",
|
||||||
|
"tags": [
|
||||||
|
"cryptography"
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -62,10 +62,10 @@ class PostDB {
|
||||||
mkdir $posts-dir unless $posts-dir.e;
|
mkdir $posts-dir unless $posts-dir.e;
|
||||||
# Write out metadata
|
# Write out metadata
|
||||||
# TODO: Track changes and only write changed files
|
# 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)
|
# Write out posts (ids are the filename)
|
||||||
for %!posts.kv -> $key, $value {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue