I often like to start new sites with a mock up that is strictly html. I get html templates from sites like Theme Forest so they are already designed for me.
I often like to start new sites with a mock up that is strictly html. I get html templates from sites like Theme Forest so they are already designed for me. All I do is modify it to fit the theme of my new site.
The biggest pain is that most of these html files have the header and footer in them so looking at the files one at a time look great but when I want to start my modifications, I'm looking for a way to make a change in the header or footer section once and then see it in all of my new pages.
Here's what I'm doing to get this done today, it's simple, easy to implement and trimmed down to just the basics to get going. I really love gulp and doing html mockups in real-time is a dream come true.
{ "name": "your project name here", "version": "1.0.0", "description": "", "main": "gulpfile.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": {}, "devDependencies": { "gulp": "latest", "gulp-concat": "latest", "browser-sync": "latest" } }
"use strict"; var gulp = require('gulp'); var concat = require('gulp-concat'); var browserSync = require('browser-sync').create(); gulp.task("concatIndex", function () { gulp.src(['partials/header.html', 'partials/indexBody.html', 'partials/footer.html']) .pipe(concat("index.html")) .pipe(gulp.dest("./")) }); gulp.task("build", ['concatIndex'], function () { browserSync.reload(); }); gulp.task('default', ['build'], function () { browserSync.init({ open: false, server: { baseDir: "./" } }); gulp.watch('partials/*.html', ['build']); });