fixed base_path file issue

This commit is contained in:
AJ ONeal 2015-01-23 14:48:44 -07:00
parent 3c2e4e7e63
commit dc8fc18fc6
1 changed files with 15 additions and 10 deletions

View File

@ -880,15 +880,20 @@
} }
*/ */
function compileThemeEntity(entity, i, arr) { function compileThemeEntity(entity, i, arr) {
var view
;
console.info("[themes] compiling " + (i + 1) + "/" + arr.length + " " + entity.path); console.info("[themes] compiling " + (i + 1) + "/" + arr.length + " " + entity.path);
// TODO less / sass / etc // TODO generate per-page for a more full 'view' object?
compiled.push({ contents: entity.body || entity.contents, path: path.join(entity.path) }); view = { entity: { collectionType: 'themes' }, url: path.join(env.base_path, entity.path) };
if (/stylesheets.*\.css/.test(entity.path) && (!/google/.test(entity.path) || /obsid/.test(entity.path))) { // TODO this is more 'preprocessing' than 'rendering', perse
// TODO XXX move to a partial return Desi.render(entity.ext, entity.body || entity.contents, view).then(function (css) {
desi.styles.push( compiled.push({ contents: css, path: entity.path });
'<link href="' + path.join(env.base_path, entity.path) + '" type="text/css" rel="stylesheet" media="all">' // TODO read theme config
); if (/stylesheets.*\.css/.test(entity.path) && (!/google/.test(entity.path) || /obsid/.test(entity.path))) {
} desi.styles.push(Mustache.render(desi.partials.stylesheet_link, view));
}
});
} }
function compileContentEntity(entity, i, arr) { function compileContentEntity(entity, i, arr) {
@ -964,8 +969,8 @@
console.info("[index] compiling " + (entity.path || entity.name)); console.info("[index] compiling " + (entity.path || entity.name));
compiled.push({ contents: html, path: path.join('index.html') }); compiled.push({ contents: html, path: path.join('index.html') });
} else { } else {
console.info("[collection] compiling " + entity.path, entity.relative_file); //console.info("[collection] compiling " + entity.path, entity.relative_file);
compiled.push({ contents: html, path: path.join(entity.relative_file) }); compiled.push({ contents: html, path: path.join(entity.relative_file.replace(env.base_path, '')) });
} }
if (/\/index.html$/.test(entity.permalink)) { if (/\/index.html$/.test(entity.permalink)) {