This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from jgsme/gulpize
gulpize
- Loading branch information
Showing
89 changed files
with
421 additions
and
722 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
node_modules | ||
|
||
.sass-cache | ||
|
||
# Cabin-specific ignored files | ||
dist | ||
.grunt | ||
build | ||
tmp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
gulp = require 'gulp' | ||
mark = require 'gulp-markdown' | ||
jade = require 'gulp-jade-template' | ||
article = require 'gulp-article' | ||
publish = require 'gulp-article-publish' | ||
fs = require 'fs' | ||
_ = require 'lodash' | ||
rename = require 'gulp-rename' | ||
styl = require 'gulp-stylus' | ||
connect = require 'gulp-connect' | ||
mkdir = require 'mkdirp' | ||
async = require 'async' | ||
run = require 'run-sequence' | ||
archive = require 'gulp-article-archive' | ||
rss = require 'gulp-article-rss' | ||
deploy = require 'gulp-gh-pages' | ||
|
||
paths = | ||
posts: 'posts/*.md' | ||
styl: 'src/*.styl' | ||
dest: 'build' | ||
|
||
gulp.task 'article', -> | ||
gulp.src paths.posts | ||
.pipe mark() | ||
.pipe article() | ||
.pipe jade('src/page.jade') | ||
.pipe article() | ||
.pipe publish(paths.dest) | ||
|
||
gulp.task 'index', -> fs.readdir 'posts', (err, files)-> | ||
gulp.src "posts/#{_.last(files)}" | ||
.pipe mark() | ||
.pipe article() | ||
.pipe jade('src/page.jade') | ||
.pipe rename('index.html') | ||
.pipe gulp.dest(paths.dest) | ||
|
||
gulp.task 'CNAME', -> gulp.src('src/CNAME').pipe gulp.dest(paths.dest) | ||
gulp.task 'gfm', -> gulp.src('github-markdown-css/github-markdown.css').pipe gulp.dest(paths.dest) | ||
gulp.task 'stylus', -> | ||
gulp.src paths.styl | ||
.pipe styl | ||
compress: true | ||
.pipe gulp.dest(paths.dest) | ||
|
||
gulp.task 'archive', (callback)-> | ||
run 'archive-json', 'archive-page', 'archive-head', callback | ||
|
||
gulp.task 'archive-json', -> | ||
gulp.src 'posts', | ||
read: false | ||
.pipe archive("#{paths.dest}/archives") | ||
|
||
gulp.task 'archive-page', -> | ||
gulp.src "#{paths.dest}/archives/*.json" | ||
.pipe jade('src/archive.jade') | ||
.pipe rename | ||
extname: '.html' | ||
.pipe gulp.dest("#{paths.dest}/archives") | ||
|
||
gulp.task 'archive-head', -> | ||
fs.readdir "#{paths.dest}/archives", (err, files)-> | ||
files = _.filter files, (file)-> /^page-\d*\.html$/.test file | ||
gulp.src "#{paths.dest}/archives/#{_.head(files)}" | ||
.pipe rename('index.html') | ||
.pipe gulp.dest("#{paths.dest}/archives") | ||
|
||
gulp.task 'rss', -> | ||
gulp.src 'posts/*.md' | ||
.pipe rss | ||
title: 'kaihatsu' | ||
description: 'development log' | ||
link: 'http://dev.jgs.me' | ||
image: 'http://dev.jgs.me/icon.png' | ||
copyright: 'MIT' | ||
updated: new Date() | ||
author: | ||
name: 'jigsaw' | ||
link: 'http://jgs.me' | ||
.pipe gulp.dest("#{paths.dest}/feed.xml") | ||
|
||
gulp.task 'default', ['article', 'index', 'archive', 'rss', 'CNAME', 'gfm', 'stylus'] | ||
gulp.task 'watch', ['default'], -> | ||
gulp.watch paths.posts, ['article', 'index'] | ||
gulp.watch paths.styl, ['stylus'] | ||
connect.server | ||
root: paths.dest | ||
|
||
gulp.task 'deploy', ['default'], -> | ||
gulp.src './build/**/*' | ||
.pipe deploy | ||
cacheDir: 'tmp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,38 @@ | ||
{ | ||
"name": "cabin-site", | ||
"name": "log", | ||
"version": "0.0.0", | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"load-grunt-tasks": "^1.0.0", | ||
"grunt-pages": "^0.11.2", | ||
"grunt-contrib-copy": "^0.7.0", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"grunt-contrib-connect": "^0.9.0", | ||
"grunt-open": "^0.2.3", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-gh-pages": "^0.9.1", | ||
"inquirer": "^0.8.0", | ||
"grunt-contrib-stylus": "^0.20.0" | ||
"description": "development log", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jgsme/log.git" | ||
}, | ||
"author": "jigsaw (http://jgs.me)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jgsme/log/issues" | ||
}, | ||
"homepage": "https://github.com/jgsme/log", | ||
"dependencies": { | ||
"async": "^0.9.0", | ||
"coffee-script": "^1.8.0", | ||
"gulp": "^3.8.10", | ||
"gulp-article": "0.0.7", | ||
"gulp-article-archive": "0.0.5", | ||
"gulp-article-publish": "0.0.3", | ||
"gulp-article-rss": "0.0.4", | ||
"gulp-connect": "^2.2.0", | ||
"gulp-data": "^1.1.1", | ||
"gulp-gh-pages": "^0.4.0", | ||
"gulp-jade-template": "0.0.5", | ||
"gulp-markdown": "^1.0.0", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-stylus": "^1.3.4", | ||
"lodash": "^2.4.1", | ||
"mkdirp": "^0.5.0", | ||
"run-sequence": "^1.0.2", | ||
"through2": "^0.6.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.