Given a content map like this:
"name":"Test map. Just to load some URLs",
"domain":"groups.csail.mit.edu",
"pages":[
{
"name":"index",
"path":"/en"
"data": {
"blog": {
"title": "Haystack Blog",
"link": "http://groups.csail.mit.edu/haystack/blog"
"subtitle": 'MIT CSAIL Research (<a href="http://haystack.csail.mit.edu/">Group Website</a>)'
}
},
"cts": {
}
}
]
}
Create a pipeline stage (before output-files) that goes over every file in sources and:
- Walks through each node and attribute in the DOM and, for example, if it finds
Haystack Blog then applies the class title. The data section in the ContentMap will be used for this.
- Saves this modified HTML (with the classes added) to a new slot in the theme object. E.g, before it was at this.data.sources[name] and we'll save this new one to this.data.mockups[name]. The reason is because with these annotations the page can be used as a mockup.
- For every class we added, keep a data structure (your choice) on theme.data that records we've done this and whether it was an attribute or the innerHTML. This structure can be converted directly into a CTS sheet for each page.. e.g, " .title { value: title }" or ".link { value(@href): link }"
- In the
output-file.js stage, create a CTS sheet for every page in data.mockups and write to it every relevant CTS rule from the data structure that you created in step 3 above.
Given a content map like this:
Create a pipeline stage (before output-files) that goes over every file in sources and:
Haystack Blogthen applies the classtitle. Thedatasection in the ContentMap will be used for this.output-file.jsstage, create a CTS sheet for every page indata.mockupsand write to it every relevant CTS rule from the data structure that you created in step 3 above.