hikaru-coffee
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -91,3 +91,3 @@ // Generated by CoffeeScript 2.3.2 | ||
this.logger.debug(`Hikaru is creating \`${colors.cyan(path.join(workDir, "scripts", path.sep))}\`...`); | ||
fse.copy(path.join(__dirname, "..", "dist", "config.yml"), configPath || path.join(workDir, "config.yml")); | ||
fse.copy(path.join(__dirname, "..", "dist", "config.yml"), configPath || path.join(workDir, "site.config.yml")); | ||
fse.readFile(path.join(__dirname, "..", "dist", "package.json")).then(function(text) { | ||
@@ -112,3 +112,6 @@ var json; | ||
var err, siteConfig; | ||
configPath = configPath || path.join(workDir, "config.yml"); | ||
configPath = configPath || path.join(workDir, "site.config.yml"); | ||
if (!fse.existsSync(configPath)) { | ||
configPath = path.join(workDir, "config.yml"); | ||
} | ||
try { | ||
@@ -186,5 +189,8 @@ siteConfig = yaml.safeLoad(fse.readFileSync(configPath, "utf8")); | ||
loadSite(workDir, configPath) { | ||
var err; | ||
var err, themeConfigPath; | ||
this.site = new Site(workDir); | ||
configPath = configPath || path.join(this.site["workDir"], "config.yml"); | ||
configPath = configPath || path.join(this.site["workDir"], "site.config.yml"); | ||
if (!fse.existsSync(configPath)) { | ||
configPath = path.join(this.site["workDir"], "config.yml"); | ||
} | ||
try { | ||
@@ -204,4 +210,8 @@ this.site["siteConfig"] = yaml.safeLoad(fse.readFileSync(configPath, "utf8")); | ||
this.site["siteConfig"]["tagDir"] = this.site["siteConfig"]["tagDir"] || "tags"; | ||
themeConfigPath = path.join(this.site["workDir"], "theme.config.yml"); | ||
if (!fse.existsSync(themeConfigPath)) { | ||
themeConfigPath = path.join(this.site["siteConfig"]["themeDir"], "config.yml"); | ||
} | ||
try { | ||
return this.site["themeConfig"] = yaml.safeLoad(fse.readFileSync(path.join(this.site["siteConfig"]["themeDir"], "config.yml"), "utf8")); | ||
return this.site["themeConfig"] = yaml.safeLoad(fse.readFileSync(themeConfigPath, "utf8")); | ||
} catch (error) { | ||
@@ -208,0 +218,0 @@ err = error; |
{ | ||
"name": "hikaru-coffee", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "A static site generator that generates routes based on directories naturally.", | ||
@@ -5,0 +5,0 @@ "main": "libs/index.js", |
87522
2019