js/index.js
function createPage(filename) {
        let page = {
            path: filename,
            rawContent: fs.readFileSync(filename, "utf8"),
            name: path.basename(filename).replace(/\.[^/.]+$/, ""),
            filename: path.basename(filename),
            folder: path.dirname(filename),
            ext: path.extname(filename),
            userData: {}
        };
        page.isMarkdown = page.ext.toLocaleUpperCase() == ".MD";
        if (page.isMarkdown)
            page.ext = ".html";
        page.template = doT.template(page.rawContent, null, page.userData);
        page.outPath = path.join(path.relative(CONTENT, page.folder), page.name + page.ext);
        page.href = CONFIG.prefix + page.outPath;
        return page;
    }
function createPage(filename) {
        let page = {
            path: filename,
            rawContent: fs.readFileSync(filename, "utf8"),
            name: path.basename(filename).replace(/\.[^/.]+$/, ""),
            filename: path.basename(filename),
            folder: path.dirname(filename),
            ext: path.extname(filename),
            userData: {}
        };
        page.isMarkdown = page.ext.toLocaleUpperCase() == ".MD";
        if (page.isMarkdown)
            page.ext = ".html";
        page.template = doT.template(page.rawContent, null, page.userData);
        page.outPath = path.join(path.relative(CONTENT, page.folder), page.name + page.ext);
        page.href = CONFIG.prefix + page.outPath;
        return page;
    }
function createPage ( filename ) { let page = { path : filename , rawContent : fs . readFileSync ( filename , "utf8" ) , name : path . basename ( filename ) . replace ( / \.[^/.]+$ / , "" ) , filename : path . basename ( filename ) , folder : path . dirname ( filename ) , ext : path . extname ( filename ) , userData : { } } ; page . isMarkdown = page . ext . toLocaleUpperCase ( ) == ".MD" ; if ( page . isMarkdown ) page . ext = ".html" ; page . template = doT . template ( page . rawContent , null , page . userData ) ; page . outPath = path . join ( path . relative ( CONTENT , page . folder ) , page . name + page . ext ) ; page . href = CONFIG . prefix + page . outPath ; return page ; }
Create page-templates
Create page - templates