I have decided to build a “content-less” site that will be generated from a snapshot view of a (generic) git repository. Which means there will be potentially thousands of generated pages for the objects: heads, tags, commits all the way to tree entries and actual blobs (taking advantage of chroma to show it all).
(Feel free to tell me it’s a ridiculous use of Hugo, but I find it a great match so far, even kind of enjoy the journey.)
I am currently generating a bunch of JSON files, which I put into assets/ (mostly because they are accompanied by non-resource-like .diff deltas which then get rendered for a comprehensive commit view).
It all works surprisingly well so far with a tiny repo. So this got me wondering where is the limit and how to get closer to it.
I figured early on that I absolutely have to generate index.md’s in the right paths no matter what (not a problem), but I somehow noticed large front matter tends to slow down generation, as if more so than processing the JSONs as a resource from virtually empty pages, hence the decision to keep everything resource-driven.
I wonder if there’s any well-established tips for sites like these (well, of this nature): no front matter, absolutely empty .Content - everything getting taken care of by the templates - and very little change (virtually none) in once-generated resources - additions only, but potentially thousands of (inter-linked) pages.
I have the ability to limit what I generate in terms of JSON, I can generate different format (also with different internal structure, depth, etc.). I am trying to avoid map lookups, sorting or calculations in the templates, mostly doing range over the JSON structure.
But I do not know if it would not have been e.g. better to keep the JSON in page bundles (with publishResources: false) instead of one centralized directory. I also do not know if I should not e.g. first load it all an cache rather than let it crawl the filesystem. Currently, I have no list pages simply because I build such from a JSON list instead, which I feel is going easy on Hugo.
Anyone with experience with anything of this sorts, I’d love to hear any tips early on before I bog myself down in the wrong paradigm. ![]()
Thanks a lot!