Skip to content

Commit 88640e6

Browse files
committed
edit readme, package.json, add gulpfile for livereload
1 parent 721244c commit 88640e6

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ After the header of each post, you can simply write down a post. You can see exa
3030
### Using drafts
3131
[Drafts](http://jekyllrb.com/docs/drafts/) is a useful feature of Jekyll. To use drafts, first we don't need the date on file name of the post and second we need to place it in `_drafts` folder. After that you can work with drafts by running Jekyll with flag `--drafts`. This blog uses bundler and normally we run by `bundle exec jekyll serve`, thus if you need to see draft as a latest post you need to run `bundle exec jekyll serve --drafts`.
3232

33+
### Start writing
34+
After cloning repo you can start writing a post. To be able to see how it would look like when served you need to install some of the requirements.
35+
36+
Go to tupleblog repo and run `npm install` to install all required node modules. Then run `bundle install` to install all required gems, and you are good to go. By default we run jekyll by `bundle exec jekyll serve --watch --drafts`, but by now I've included [Gulp to help in live-reloading](https://nvbn.github.io/2015/06/19/jekyll-browsersync/), so to observe how the blog looks like you need to do 2 things.
37+
38+
- go to `_config.yml` and then go to line 9. Do following comments there.
39+
- run `gulp` and the blog is served!
40+
3341
### Members
3442
- [Titipat Achakulvisut (My)](http://titipata.github.io)
3543
- [Tulakan Ruangrong (Tul)](https://github.com/bluenex)

_config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ words_per_minute: 800
66
# Your site's domain goes here (eg: //mmistakes.github.io, http://mademistakes.com, etc)
77
# When testing locally leave blank or use http://localhost:4000
88

9-
# url: # comment this when pushing to server
10-
url: http://tupleblog.github.io # comment this when testing locally
9+
url: # comment this when pushing to server
10+
# url: http://tupleblog.github.io # comment this when testing locally
1111

1212
# Owner/author information
1313
owner:
@@ -70,4 +70,4 @@ kramdown:
7070
coderay_css: class
7171

7272
include: [".htaccess"]
73-
exclude: ["lib", "config.rb", "Capfile", "config", "Gemfile", "Gemfile.lock", "README.md", "LICENSE", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "*.sublime-project", "*.sublime-workspace", "test", "spec", "Gruntfile.js", "package.json", "node_modules"]
73+
exclude: ["lib", "config.rb", "Capfile", "config", "Gemfile", "Gemfile.lock", "README.md", "LICENSE", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "*.sublime-project", "*.sublime-workspace", "test", "spec", "Gruntfile.js", "package.json", "node_modules", "gulpfile.js"]

gulpfile.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var gulp = require('gulp');
2+
var shell = require('gulp-shell');
3+
var browserSync = require('browser-sync').create();
4+
5+
// Task for building blog when something changed:
6+
gulp.task('build', shell.task(['bundle exec jekyll build --watch --drafts']));
7+
// Or if you don't use bundle:
8+
// gulp.task('build', shell.task(['jekyll build --watch']));
9+
10+
// Task for serving blog with Browsersync
11+
gulp.task('serve', function () {
12+
browserSync.init({server: {baseDir: '_site/'}});
13+
// Reloads page when some of the already built files changed:
14+
gulp.watch('_site/**/*.*').on('change', browserSync.reload);
15+
});
16+
17+
gulp.task('default', ['build', 'serve']);

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
"node": ">= 0.10.0"
1414
},
1515
"devDependencies": {
16+
"browser-sync": "^2.10.1",
17+
"bundler": "^0.8.0",
1618
"grunt": "~0.4.1",
1719
"grunt-contrib-clean": "~0.5.0",
20+
"grunt-contrib-imagemin": "~0.2.0",
1821
"grunt-contrib-jshint": "~0.6.3",
1922
"grunt-contrib-uglify": "~0.2.2",
2023
"grunt-contrib-watch": "~0.5.2",
21-
"grunt-contrib-imagemin": "~0.2.0",
22-
"grunt-svgmin": "~0.2.0"
24+
"grunt-svgmin": "~0.2.0",
25+
"gulp": "^3.9.0",
26+
"gulp-shell": "^0.5.1",
27+
"lodash": "^3.10.1"
2328
}
2429
}

0 commit comments

Comments
 (0)