nolibc / migi

An open-source, minimal static site generator written in Rust.
1 stars 0 forks source link

CSV instead of YAML #2

Closed nolibc closed 1 year ago

nolibc commented 1 year ago

Replace the current caching implementation using YML with CSV.

The current implementation is not as scalable and is already presenting issues.

https://docs.rs/csv/1.1.6/csv/

nolibc commented 1 year ago

Current Thoughts:

There will be 3 steps in this. The first 2 are related to indexing and caching while the last is related to which files actually get converted.

1) Check if a cache exists. If no, create one and cache every single file. 2) Check to make sure every file in the content/ directory has been cached (is present in the cache file). If not, cache it. 3) Iterate over all the markdown files and check their date modified against the cache's date modified. If it is the same, skip that file. If it is different, we know the file has been changed since last build and needs to be re-converted.

For step 3, this process would involve re-building the markdown file to HTML, but also removing the record of that file in the cache and appending a new record of the file with the updated date modified.