topiary-io / topiary

a modern content management system
Other
2 stars 0 forks source link

Read the config before the server starts. #8

Closed doesntgolf closed 8 years ago

doesntgolf commented 8 years ago

We'll need to have some Topiary configuration vars in config.toml (think things like setting the admin location, using a separate server, knowing where the contentdir/staticdir/etc are, setting default categories/tags etc.), so we'll need to be able to read toml, yaml, and json.

The best package for this definitely looks to be Viper. (Coincidentally (or perhaps not...) made by the same guy who created Hugo. For now, let's just set it up to read an admin location var and then serve the admin there (default to /admin/).

This will also help us with eventually reading content front matter (for separating title, date, categories, etc. into separate fields from the content body).

schtauffen commented 8 years ago

Very basic example looking for "AdminLocation" added. a2d50c5