Add rough outline of blog indexing
Now the context is properly populated with data, and if you have a
matching template to go with it, you'll get a blog index going.
Right now it's very simple and requires a lot of manual work to get
going, but it's something.
Move config loading out of loadMetadata
This way I can put non-context metadata in config.cfg without breaking
Remove base_url config and code
I'm new at webdev stuff so I was being dumb with testing; I thought I
needed the base_url thing so links would work properly but if you test
using a local http server everything works fine with relative URLs.
So less code needed = more better.
Tweak CSS template
Now it's using HSL for colours instead of hexes, and it bases everything
off of two main colours so that it's quick and painless to re-theme the
site by just changing the hue.
Fix styling for mobile devices
It's not perfect, but it's enough to run with for now.
Correctly set permissions on output files
To be able to host files and make copying them to a webhost easy, the
files need 755 permissions.
Also touched up some templates.
Add nav generation
Automatically create nav links for any non-blog page you have on your
site. We don't want a giant long list of nav links at the top to each
individual blog post so we exclude those from the list of links.
I had to add the base_url thing to the config to make nav generation as
simple as possible, since now everything is relative to the base_url and
saves a lot of complicated logic in the link generation stage. It's not
a major headache though for anyone using the tool.
Add proper template lookup
It will now look for the template filename.mustache for any filename.md
it processes, and will default to post.mustache for anything recognized
as a blog post per the findBlogPosts procedure.
It defaults to page.mustache for any non-blog page without you having to
do anything about it. So if the default template is OK for a new page
you don't need to make a new template for it, but if you want a specific
template for a specific page (i.e. the index page might hold a list of
blog posts) you just copy the page.mustache template and edit that.
Set up for future blog indexing
I don't know how I want to do this feature yet, but the parts are all
Add sorting to blog entries
Now it sorts them automatically. For now it goes oldest first,
but that's an easy change.
Detect blog posts and render them accordingly
We add an extra walk of the content dir to pick out anything that we
assume is a blog, and we render it as a blog using the appropriate
templates; e.g. post.mustache.
Right now nothing happens with this; we just dump it into a seq for
future use, but it's going to let you add a blog index thing
Fix a directory creation bug in initCmd
There was a bug where initCmd would only work when you supplied a
directory to it, not when running it in an empty existing directory.
It now accounts for both use-cases properly, which also let us remove
some conditionals further down in the procedure making everything
simpler. Which is nice.
ord() already does the right thing with enums
We don't need to shadow the built-in `ord()`.
Fix a bug in buildCmd with missing output dir
The build command would break spectacularly if you happened to remove
the output directory (say with 'dtt clean'); this makes sure it doesn't
TODO: Re-generate $OUTPUT/css/style.css somehow
Change manual quit codes to use an enum
So we use the same number to mean the same thing, and to make the code
a little bit more self-documenting.
Also fix a typo (missing ")
Add --all and --force flags to 'dtt clean'
By default clean will just wipe out your output directory so you can
start from scratch, but you can add --all and --force to make it wipe
everything clean so you can start completely from scratch.
Add -f/--force switch to dtt init
Now it won't init in a non-empty directory unless you force it to by
using the switches. Also fixed the bug where it wouldn't actually create
the directory you supplied via [DIR]...