diff --git a/sitegin/nunjucks.js b/sitegin/nunjucks.js
index 7ad4405c1384bd1924e0fe931213d52498279438..0a364b95460e6b232fa80c0729e7e38e7fdc8bb0 100644
--- a/sitegin/nunjucks.js
+++ b/sitegin/nunjucks.js
@@ -101,7 +101,7 @@ module.exports = function(data, type) {
             //reject(new Error('Error rendering template '+o.file));
             reject(err);
           }
-          resolve({val: val, type: o.type});
+          resolve({content: val, type: o.type});
         });
       }));
     });
diff --git a/sitegin/theme.js b/sitegin/theme.js
index 441c0e19e89ab6040faa2ac1b19e200e126e48f1..1b00c187d59577f76452745f66f1e1ae32bf6b7b 100644
--- a/sitegin/theme.js
+++ b/sitegin/theme.js
@@ -12,7 +12,7 @@ module.exports = function(obj) {
       jobs.run('nunjucks', obj, type)
       .then(function(data) {
         data.forEach(function(o){
-          if(o.type == 'html') obj.content = o.val;
+          if(o.type == 'html') obj.content = o.content;
           else {
             if(!obj.otherContent) obj.otherContent = [];
             obj.otherContent.push(o);
diff --git a/sitegin/writeFiles.js b/sitegin/writeFiles.js
index 295a6fea9de2510aa04c9eb402a9ca9f995cfad6..786c4c02f13344d956d666112bf3e49b8455e252 100644
--- a/sitegin/writeFiles.js
+++ b/sitegin/writeFiles.js
@@ -8,16 +8,28 @@ module.exports = function(obj) {
     var builddir = obj.config.builddir;
     var todo = 0;
 
-    var writeFile = function(article) {
-      var filename = path.join(builddir,article.file,'index.html');
-      mkdirp(path.dirname(filename), function() {
-        fs.writeFile(filename, article.content, function(err) {
+    var doWrite = function(file, content) {
+      todo++;
+      mkdirp(path.dirname(file), function() {
+        fs.writeFile(file, content, function(err) {
           if(err) reject(err);
           todo--;
           if(todo <= 0) resolve(obj);
         });
       });
     }
+
+    var writeFile = function(article) {
+      var filename = path.join(builddir,article.file,'index.html');
+      doWrite(filename, article.content);
+      if(article.otherContent) {
+        article.otherContent.forEach(function(o) {
+          var f = path.join(builddir,article.file,'index.'+o.type);
+          console.log(f);
+          doWrite(f, o.content);
+        })
+      }
+    }
     obj.pages.forEach(function(o) { writeFile(o); })
     obj.redirects.forEach(function(o) { writeFile(o); })
     obj.tags.forEach(function(o) { writeFile(o); })