diff --git a/.gitignore b/.gitignore index 763b1c9..249aee8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ elm-stuff/ build/ node_modules/ -dist/ diff --git a/Gulpfile.js b/Gulpfile.js deleted file mode 100644 index 6ce6ac0..0000000 --- a/Gulpfile.js +++ /dev/null @@ -1,80 +0,0 @@ -var gulp = require('gulp'); -var liveServer = require('live-server'); -var $ = require('gulp-load-plugins')({}); -var del = require('del'); - -function watchElmAndRun(...args) { - return gulp.watch('**/*.elm', args); -} - -gulp.task('build', function() { - return gulp.src('src/App.elm') - .pipe($.plumber({ - errorHandler: $.notify.onError({ sound: false, message: 'Elm error' }) - })) - .pipe($.elm.bundle('App.js', { - warn: true, - debug: true - })) - .pipe(gulp.dest('build/')); -}); - -gulp.task('prod:elm', ['prod:clean'], function() { - return gulp.src('src/App.elm') - .pipe($.elm.bundle('App.js')) - .pipe($.uglify()) - .pipe(gulp.dest('dist/build')); -}); - -gulp.task('prod:clean', function() { - return del(['dist/**/*']); -}); - -gulp.task('prod:vendor', ['prod:clean'], function() { - return gulp.src('vendor/*').pipe(gulp.dest('dist/vendor')); -}); - -gulp.task('prod:html', ['prod:clean'], function() { - return gulp.src('index.html') - .pipe($.rename('200.html')) - .pipe(gulp.dest('dist')); -}); - -gulp.task('prod:css', ['prod:clean'], function() { - return gulp.src('style.css').pipe(gulp.dest('dist')); -}); - -gulp.task('prod:img', ['prod:clean'], function() { - return gulp.src('img/*').pipe(gulp.dest('dist/img')); -}); - -gulp.task('prod:js', ['prod:clean'], function() { - return gulp.src('js/*').pipe(gulp.dest('dist/js')); -}); - -gulp.task('prod:content', ['prod:clean'], function() { - return gulp.src('content/**/*', { base: 'content' }).pipe(gulp.dest('dist/content')); -}); - -gulp.task('deploy', [ - 'prod:vendor', 'prod:html', 'prod:css', - 'prod:js', 'prod:img', 'prod:content', 'prod:elm' -], function() { - $.util.log('Deploying version: ', require('./package.json').version); - return $.surge({ - project: './dist', - domain: 'elmplayground.com' - }); -}); - -gulp.task('start', ['build'], function() { - watchElmAndRun('build'); -}); - -gulp.task('serve', function() { - liveServer.start({ - open: false, - ignore: /elm-stuff/, - file: 'index.html' - }); -}); diff --git a/README.md b/README.md index bf31a81..daf3996 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,22 @@ A blog about Elm that's written in Elm. ## Running locally +Add your Github token to src/GithubToken.elm file (https://github.com/settings/tokens) + ``` npm install elm package install -(in one tab) gulp start -(in aother) gulp serve -add your Github token to src/GithubToken.elm file (https://github.com/settings/tokens) -open http://localhost:8080 +npm start ``` +Open `http://localhost:8081` + +## Build bundle + +``` +npm run build +``` + +## Contributing + Contributions welcome! diff --git a/example.env b/example.env new file mode 100644 index 0000000..860a3b5 --- /dev/null +++ b/example.env @@ -0,0 +1 @@ +GITHUB_TOKEN='example-token' diff --git a/index.html b/index.html index 34a8c52..ef340d5 100644 --- a/index.html +++ b/index.html @@ -6,19 +6,16 @@
- - - - + +