refactor: folder structure & filename

This commit is contained in:
endiliey 2018-08-01 16:55:53 +08:00
parent 9070fb50ab
commit dbf78c5c14
10 changed files with 79 additions and 74 deletions

View file

@ -25,12 +25,12 @@ module.exports = async function load(sourceDir) {
? path.resolve(siteConfig.dest)
: path.resolve(sourceDir, '.blogi/dist');
// resolve the path of our app theme/ layout
const themePath =
!siteConfig.themePath ||
!fs.existsSync(path.resolve(sourceDir, siteConfig.themePath))
? path.resolve(__dirname, '../theme')
: siteConfig.themePath;
// resolve the path of our app user interface layout
const uiPath =
!siteConfig.uiPath ||
!fs.existsSync(path.resolve(sourceDir, siteConfig.uiPath))
? path.resolve(__dirname, '../ui')
: siteConfig.uiPath;
const publicPath = siteConfig.base || '/';
@ -39,7 +39,7 @@ module.exports = async function load(sourceDir) {
blogDatas,
sourceDir,
outDir,
themePath,
uiPath,
publicPath
};
};