3 ms·
My website is getting a bit big to shove the entire thing into a Git repo, unfortunately. At the very least I would want to have sparse checkouts. I’ve thought
by dietrichepp 6y ago
My website is getting a bit big to shove the entire thing into a Git repo, unfortunately. At the very least I would want to have sparse checkouts.
I’ve thought about Hugo but it might require a serious migration effort. My current website is written in Go templates so I can do something like:
{{.SrcFile "_src.c"}}
And it will read _src.c and set it up to be highlighted using C syntax rules. Leading underscore just means that the file doesn’t get deployed. This is just one example, there are a number of different things I’ve added to my website like this over the years.
Things would be different if I had chosen a static website generator from the start rather than letting things evolve naturally from hand-written HTML files. Currently, what I want to do is get rid of the templating and use DOM manipulation, so I’d write the above like
<src-file src="_src.c" />
Just because it would make editing the files more convenient. Putting something like C source code directly in an HTML file is too much of a bother, and I put a lot of source code in my website, so anything I can do to save time here means I can write more articles. Markdown makes it easier to embed source code but it’s just not good enough to replace HTML for my use case.