var fs = require('fs');

module.exports = {

    setup: function(config) {
        this.activeTemplatePath = config.activeTemplatePath;
        this.templateTagName = config.templateTagName;
    },

    get: function(basepath, content_type, request_options, callback) {
        var self = this;

        return callback(
            null,
            {
                tag: {
                    [self.templateTagName]: self.loadActiveTemplateFromIndex()
                },
                block: {}
            },
            {},
            {}
        );
    },

    loadActiveTemplateFromIndex: function() {
		if(!this.activeTemplatePath) {
			return "";
		}

        try {
			var allTemplates = JSON.parse(fs.readFileSync(__dirname + this.activeTemplatePath  + 'index.json', 'utf8'));
            var activeTemplate = allTemplates.find(template => template.isActive);

            if (!activeTemplate || !activeTemplate.fullMarkupFile) {
                console.log('Error -- active template not found');
                return '';
            }

            return fs.readFileSync(__dirname + this.activeTemplatePath + activeTemplate.fullMarkupFile, 'utf8');
        } catch (e) {
            console.log(e);
        }

        return '';
	}
};

@@ -604,18 +604,24 @@
 ion() %7B%0A
-%09%09
+        
 if(!this
@@ -647,24 +647,39 @@
 ) %7B%0A
-%09%09%09return %22%22;%0A%09%09
+            return '';%0A        
 %7D%0A%0A 
@@ -695,11 +695,20 @@
 y %7B%0A
-%09%09%09
+            
 var 

fix indents