yesodweb/yesod — Issue #168: Make scaffold more flexible
Author: luite
Created: 2011-10-31 19:46:46+00:00
State: open

the updated scaffold is much cleaner than the old one, but I think it's a bit too inflexible, for example see:

http://groups.google.com/group/yesodweb/browse_thread/thread/79e1808d5d6f50e5

I think we need some way to let the user add site-specific configuration to his application, with settings stored in a .yml file for example. I propose the following changes:

In Settings.hs, add:
- a new data type data SiteConfig = SiteConfig
- a new function loadSiteConfig :: IO SiteConfig
- add a SiteConfig field to AppConfig, use the loadSiteConfig function to get the value

this way the user can add his own configuration fields without interfering with the existing ones that are required for the scaffold. loadSiteConfig can load and parse site-specific configuration files at startup, and throw an exception if something's amiss.

(the name SiteConfig is not ideal, does anyone have a better suggestion?)