cuibonobo / cuibonobo.com

A static site generator for cuibonobo.com
https://cuibonobo.com
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

Posts are added to the index in an inconsistent order #62

Closed cuibonobo closed 2 years ago

cuibonobo commented 2 years ago

When the index is built from scratch, new posts are added to the top of latest.json. If a post is added to an existing index, it's added to the bottom.

cuibonobo commented 2 years ago

It might help to save deterministic JSON so that the files don't reflect insertion order.

It might be good to write a script to make all existing JSON data in the project deterministic.

cuibonobo commented 2 years ago

I'm now realizing that the display of items on the site is determined by these non-deterministic JSON objects. Instead of being a dictionary, the latest index should be a list that shows posts in reverse chronological order. Anything that is using the latest index to get the content of a post based on its ID should instead read directly from the posts directory. This means you no longer need the type to retrieve a post object.