Why (yet) another static site generator?
So this website and all its content is produced through my own static site
generator called simply
dtt, which is my
attempt at a clever *nix style name since it stands for Do The Thing.
Those were my feelings after researching what tool(s) to use to write my website and blog with; I just wanted a tool that would do the thing I wanted without making me jump through hoops or make a big to-do about it. Let me write some Markdown, place some static assets like a CSS file or even actual HTML files in a folder and tell it to build it all and it would just work.
Now I understand that for the authors of all these other tools it feels about the same for them to use their tools as it does for me to use mine, at least mostly. So I'm well aware that the way this tool works might only be reasonable if you expect things to work the way I want them to work.
The guiding principle of
dtt is simplicity first. Don't over-engineer things
and don't make it hard to just put something simple up on the web. There's only
four steps involved to get your website generated properly:
dtt init [DIR]
- Write some Commonmark Markdown in a file in
That's it. Now you have a fully functional static website inside
you can publish using pretty much any hosting solution you want.
There's obviously a bunch of tweaking you can do with the stylesheet, or with the templates, but to get up and running that's all of the things you have to do in order to get something to put online. To make it easier on you the tool makes some automatic guesses about what to do with certain content, but otherwise leaves everything alone and simply copies files from the content directory to the output directory. This makes static assets a breeze.
Here's the guesswork that happens:
- It will convert any *.md file to .html.
- It will use filename.mustache as the template for filename.md.
- It will use page.mustache if no named template exists.
- If your Markdown filename starts with the string YYYY-MM-DD it's assumed to be a blog-post (the rest of the filename after that becomes the slug).
- If your Markdown file lives in one of the following directories it's also considered a blog-post (regardless of filename): blog, blogs, post, posts, articles, journal, journals.
- Blog posts are rendered using the post.mustache template.
- Any page not considered a blog post will be linked to automatically in the top menu area.
- Creation date of the blog-post will be the YYYY-MM-DD string from the filename or the result of stat.ctime
That's all. Nothing else magical happens. You can combine the different kinds of
blog directories if you want and the tool will treat them all the same. You can
combine both having a blog directory and naming the files with YYYY-MM-DD. You
can skip having a blog and just make a static webpage with individual pages. The
file and directory structure inside
/output/ will mimic the one inside
so you can link manually to things if you want, like images etc.
It's all designed to be low friction and simple. It eschews programmatic templates for this reason, and non-standard Markdown extensions like frontmatter, it also doesn't have CSS or HTML preprocessors, and does not include any JS by default in its templates or any webfonts.
Don't make the web more complicated than it needs to be.