Allow lists of directories for sourcedir, datadir, filesdir #22

merged 5 commits into from Aug 9, 2011


None yet
2 participants

league commented Aug 9, 2011

I wanted to have a set of sites that can grab template, data, and static files from shared directories. This patch allows the sourcedir, datadir, and filesdir to be specified in config.yaml by either a single string (as they worked previously), or a list of strings. In the case of a list, those directories are searched in order whenever a named file is requested. For filesdir, the entries within the specified directories are merged together under deploydir.

One small caveat is what happens when multiple files in the search paths have the same name. The sourcedir and datadir will return the first one found. This is reasonable; the only gotcha is when the shadowing of a file name changes between runs: yst will not detect this as a changed file (unless it also has been modified). In the case of file name clashes in multiple filesdir directories, one will clobber the other (again, the first one wins).

This change set includes updates to the documentation and the demo site (to take advantage of the new feature).

league added some commits Aug 8, 2011

@league league Replace `templatedir` with `sourcedir` in `demo/config.yaml`
The source and documentation recognize `sourcedir` as the correct
attribute for the directory containing all templates and page sources.
Mentioning `templatedir` in the demo `config.yaml` is confusing.
@league league Allow `sourcedir`, `datadir`, `filesdir` to specify a list of dirs.
When looking for a file, search the list of directories in order.
@league league Modify demo site to use multiple dirs for `sourcedir`, `filesdir`.
This demonstrates merging files from multiple directories, and finding
templates in a directory list.
@league league Update documentation regarding directory lists for `sourcedir` etc. 88ba034
@league league Fix `cabal install` after moving some demo files. 22548c3

@jgm jgm added a commit that referenced this pull request Aug 9, 2011

@jgm jgm Merge pull request #22 from league/master
Allow lists of directories for sourcedir, datadir, filesdir

@jgm jgm merged commit deaba8d into jgm:master Aug 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment