On the output side of things, we'll loop over a collection using mustache. Here's an example for CSS:
{{#stylesheets}}
<style type="text/css"
media="screen"
id="{{{filename}}}">
{{{content}}}
</style>
{{/stylesheets}}
On the Python side, each element of the stylesheets array would be a hash (perhaps of type externalFile) like this:
{ filename: " ",
assetType: " ",
content: " " }
Then, to create an array of such hashes (for CSS files) it might be something like
TO Create an array of external file hashes
for pathnames in directory
create an externalFile instance
if pathname extension is "css"
Then I just have to define a class for externalFile that subclasses dict type, and a corresponding __init__ method, like
def __init__(self): # not sure if this should be __init__(self, dict)
self['filename'] = " "
self ['assetType'] = " "
self ['content'] = " "