diff options
| author | Mathias Biilmann Christensen <info@mathias-biilmann.net> | 2017-09-02 14:08:54 -0700 |
|---|---|---|
| committer | Mathias Biilmann Christensen <info@mathias-biilmann.net> | 2017-09-02 14:08:54 -0700 |
| commit | 2385c63edd389348d2412bab1749409303b9b22f (patch) | |
| tree | 5f56c8ec316e6d2099a70c1c9712ace19f36669e /gulpfile.babel.js | |
| parent | f70a7350a503c9e85190a835ef77b938dad63dc4 (diff) | |
Setup cms with netlify identity
Diffstat (limited to 'gulpfile.babel.js')
| -rw-r--r-- | gulpfile.babel.js | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 77e0670..a50a03c 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -19,23 +19,7 @@ const defaultArgs = ["-d", "../dist", "-s", "site"]; gulp.task("hugo", (cb) => buildSite(cb)); gulp.task("hugo-preview", (cb) => buildSite(cb, ["--buildDrafts", "--buildFuture"])); - -gulp.task("cms", () => { - const match = process.env.REPOSITORY_URL ? process.env.REPOSITORY_URL : cp.execSync("git remote -v", {encoding: "utf-8"}); - let repo = null; - match.replace(/github.com[:/](\S+)(\.git)?/, (_, m) => { - repo = m.replace(/\.git$/, ""); - }); - gulp.src("./src/cms/*") - .pipe(replace("<% GITHUB_REPOSITORY %>", repo)) - .pipe(gulp.dest("./dist/admin")) - .pipe(browserSync.stream()); - gulp.src(["./node_modules/netlify-cms/dist/*.*", "!./node_modules/netlify-cms/dist/*.html"]) - .pipe(gulp.dest("./dist")) - .pipe(browserSync.stream()) -}); - -gulp.task("build", ["css", "js", "hugo", "cms"]); +gulp.task("build", ["css", "js", "hugo"]); gulp.task("build-preview", ["css", "js", "hugo-preview"]); gulp.task("css", () => ( @@ -79,7 +63,7 @@ gulp.task("svg", () => { .pipe(gulp.dest("site/layouts/partials/")); }); -gulp.task("server", ["hugo", "css", "js", "svg", "cms"], () => { +gulp.task("server", ["hugo", "css", "js", "svg"], () => { browserSync.init({ server: { baseDir: "./dist" @@ -87,7 +71,6 @@ gulp.task("server", ["hugo", "css", "js", "svg", "cms"], () => { }); gulp.watch("./src/js/**/*.js", ["js"]); gulp.watch("./src/css/**/*.css", ["css"]); - gulp.watch("./src/cms/*", ["cms"]); gulp.watch("./site/static/img/icons/*.svg", ["svg"]); gulp.watch("./site/**/*", ["hugo"]); }); |
