Sort json keys
This commit is contained in:
parent
07a9b29c00
commit
9a87e7825a
6 changed files with 28 additions and 28 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue