diff --git a/README.md b/README.md index cfb95d9..f2bb713 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ Supporting several configs in this priority: "baseUrl": "http://localhost/" } }, - "structureJsonPath": "./partials/site-structure.json", + "structure": { + // ... + }, "destinationPath": "./build/", "navigationPath": "./partials/", "ampPath": "./partials/pages/Blog/*.pug", diff --git a/package.json b/package.json index a3aca00..c2eaa1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mvw-creator", - "version": "1.0.11", + "version": "1.1.0", "description": "Module to generate a static website using pug, scss and typescript.", "license": "MIT", "author": { @@ -20,7 +20,7 @@ "@types/gulp-load-plugins": "0.0.30", "@types/jasmine": "2.5.54", "@types/marked": "0.3.0", - "@types/node": "8.0.26", + "@types/node": "8.0.28", "@types/strip-json-comments": "0.0.30", "@types/vinyl": "2.0.1", @@ -30,7 +30,7 @@ }, "dependencies": { "app-module-path": "2.2.0", - "autoprefixer": "7.1.3", + "autoprefixer": "7.1.4", "copyfiles": "1.2.0", "gulp": "github:gulpjs/gulp#4.0", @@ -47,9 +47,9 @@ "jstransformer-marked": "1.0.2", "marked": "0.3.6", "moment": "2.18.1", - "mvw-navigation": "2.0.5", + "mvw-navigation": "2.0.6", "mvw-search-index": "2.1.4", - "pug": "2.0.0-rc.3", + "pug": "2.0.0-rc.4", "pug-lint": "2.5.0", "strip-json-comments": "2.0.1" }, diff --git a/ts/creator-config.ts b/ts/creator-config.ts index d57a2da..65f06da 100644 --- a/ts/creator-config.ts +++ b/ts/creator-config.ts @@ -18,6 +18,6 @@ export interface ICreatorConfig { pugPath: string; pugLintPath: string; siteTitle?: string; - structureJsonPath: string; + structure: string; searchIndex?: ISearchIndexConfig | boolean; } diff --git a/ts/creator.ts b/ts/creator.ts index cb8f9f6..5526a82 100644 --- a/ts/creator.ts +++ b/ts/creator.ts @@ -7,6 +7,7 @@ import * as moment from "moment"; import "moment/locale/de"; import { Navigation } from "mvw-navigation"; import { SearchIndex } from "mvw-search-index"; +import { EOL } from "os"; import * as path from "path"; import * as File from "vinyl"; @@ -44,7 +45,7 @@ if (config.environments.base) { let navigation: Navigation; const getNavigation = () => { - return navigation || (navigation = new Navigation(require(path.join(process.cwd(), config.structureJsonPath)))); + return navigation || (navigation = new Navigation(config.structure)); }; const getScope = (file: File, isAmp: boolean = false) => { @@ -92,12 +93,13 @@ const sitemap = () => { const writeNavigation = () => { if (config.navigationPath) { + const fel = EOL + EOL; fs.writeFileSync(path.join(config.navigationPath, "./site-overview.pug"), - getNavigation().writeNavigation("allplain")); + getNavigation().writeNavigation("allplain") + fel); fs.writeFileSync(path.join(config.navigationPath, "./topnavigation.pug"), - getNavigation().writeNavigation("top")); + getNavigation().writeNavigation("top") + fel); fs.writeFileSync(path.join(config.navigationPath, "./footernavigation.pug"), - getNavigation().writeNavigation("footer")); + getNavigation().writeNavigation("footer") + fel); } };