I've been feeling like I'm hitting limitations on berrygen's capabilities. For example, I was unable to generate a feed of posts without manually making the links in a Markdown document. Since the requirements are so rigid, I think that my only way forward was to use a batch script to pipe the output file back into itself repeatedly. At the time of writing, there are 48 (now 49!) entries on this site. That would mean I need to process the same file 49 times, appending a shortcode at the end for the next post to render.
Once that was done, there was still the case of pagination. I had no access to the collection of objects without first generating a page with a collection of objects, and then using that as a source for the next pass, which eventually brought my project out of scope. That means only one thing. My implementation was far too inefficient and unwieldy.
In my search for a decent static-site generator using only Rust, I found Zola, which is powered by Tera. Some initial tests using my existing template were rather successful since Tera is inspired by Jinja2, and I was using minijinja in berrygen. There were some errors related to shortcodes, and the output was almost identical, with mine being cleanly formatted. The frontmatter (or grey-matter, in my case) needed adjusting, and I had to import the entries from jrnl and process those as individual files. Zola also allows me to use extra frontmatter that isn't serialized to a struct. I couldn't figure out how to implement that in my own implementation without crashes or forcing the user into an extremely tight box, even when parsing the extra frontmatter as a HashMap
.
Once I had my posts formatted and exported from jrnl, Zola just worked. I don't mean it just worked, it worked even after deviating from the "Getting Started" guide and immediately jumping into making my own template, unlike Hugo, which had a gosh-darn stroke out of the box without any sort of helpful error messages. I discovered that sometime in June when I was helping a good friend setup his art portfolio.
All in all, this whole thing was a learning experience. Not every project will be a success, nor will every project get finished or published "because it needs to be".