3 ms·
> It seems to me that the performance of a static site generation is irrelevant, and thus time spent on this is really wasted effort. Another consideration is
by chriswarbo 10y ago
> It seems to me that the performance of a static site generation is irrelevant, and thus time spent on this is really wasted effort.
Another consideration is pages which take a long time to render. When I'm writing about code (which is a lot!) I use a literate programming style, so that code snippets on a page can be executed and have their output embedded in the HTML. This ensures that the code I'm discussing actually works as claimed, and keeps everything self-contained; but it can make rendering arbitrarily slow!
At the moment, the longest wait is a few minutes for the graphs on http://chriswarbo.net/blog/2014-07-23-fib.html http://chriswarbo.net/blog/2014-07-23-fib.html and the images on http://chriswarbo.net/projects/procedural/cantor.html http://chriswarbo.net/projects/procedural/cantor.html
As long as the build system is incremental (I use GNU Make) the cost only has to be paid when changing those pages (either their content, or a template), so it doesn't slow down the edit/build cycle for other pages.
- 0xCMP 10y agoDo you have an example that shows this? I'm interested in bringing something like that into my own site.
- chriswarbo 10y agoI wrote it up at http://chriswarbo.net/projects/activecode http://chriswarbo.net/projects/activecode The process I use is very simple: shell commands are written as attributes of code blocks, and during rendering the content of the code blocks will be piped into those commands. Hence we can run a bash script by giving its code block a pipe="bash" attribute, python scripts by using pipe="python", haskell by using pipe="runhaskell", and so on for anything that can be called from a shell. This is all powered by a couple of scripts based on Pandoc. If you want to see some examples, click the "View Source" links at the bottom of my site. The pages I linked to above are quite complex, but some simpler examples are: - The blog post listing comes from a `find` command http://chriswarbo.net/blog.html http://chriswarbo.net/blog.html - Images can be embedded using base64 URIs http://chriswarbo.net/blog/2015-06-06-more_git.html http://chriswarbo.net/blog/2015-06-06-more_git.html - Code snippets can be checked, and we can even include real error messages http://chriswarbo.net/blog/2015-11-12-calculating_arity.html http://chriswarbo.net/blog/2015-11-12-calculating_arity.html