From 2385c63edd389348d2412bab1749409303b9b22f Mon Sep 17 00:00:00 2001 From: Mathias Biilmann Christensen Date: Sat, 2 Sep 2017 14:08:54 -0700 Subject: Setup cms with netlify identity --- gulpfile.babel.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'gulpfile.babel.js') 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"]); }); -- cgit v1.3