Permalink
Browse files

Initial commit

  • Loading branch information...
1 parent e1663bf commit df5a656b3e26d8dd8a8f3bbdd54185cf050fef65 @mikevalstar committed Mar 13, 2015
Showing with 311 additions and 0 deletions.
  1. +3 −0 .bowerrc
  2. +13 −0 .editorconfig
  3. +9 −0 .gitignore
  4. +27 −0 .jshintrc
  5. +104 −0 Gulpfile.js
  6. +1 −0 index.js
  7. +66 −0 less/main.less
  8. +5 −0 less/pages/home.less
  9. +31 −0 package.json
  10. +7 −0 src/index.md
  11. +6 −0 src/pages/about.md
  12. +12 −0 templates/home.hbt
  13. +4 −0 templates/partials/footer.hbt
  14. +23 −0 templates/partials/header.hbt
View
@@ -0,0 +1,3 @@
+{
+ "directory": "assets/components"
+}
View
@@ -0,0 +1,13 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
View
@@ -0,0 +1,9 @@
+# NPM files
+node_modules
+npm-debug.log
+
+# secret files
+.s3.json
+
+# Compiled
+build
View
@@ -0,0 +1,27 @@
+{
+ "node" : true,
+ "browser" : true,
+ "jquery" : true,
+
+ "curly": false,
+ "eqeqeq": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": true,
+ "plusplus": false,
+ "undef": true,
+ "unused": true,
+
+ "debug": false,
+ "devel": false,
+ "laxcomma": true,
+ "laxbreak":true,
+ "immed": true,
+ "nonew": false,
+
+ "strict": false,
+ "white": true,
+
+ "-W015": true,
+ "-W033": false
+}
View
@@ -0,0 +1,104 @@
+// gulp related
+var gulp = require('gulp'),
+ gulp_front_matter = require('gulp-front-matter'),
+ assign = require('lodash').assign,
+ clean = require('gulp-clean'),
+ connect = require('gulp-connect'),
+ less = require('gulp-less'),
+ autoprefixer = require('gulp-autoprefixer'),
+ runSequence = require('run-sequence'),
+ s3 = require('gulp-s3-upload'),
+ path = require('path');
+
+// Metalsmith related
+var gulpsmith = require('gulpsmith'),
+ markdown = require('metalsmith-markdown'),
+ templates = require('metalsmith-templates'),
+ permalinks = require('metalsmith-permalinks'),
+ collections = require('metalsmith-collections'),
+ Handlebars = require('handlebars'),
+ fs = require('fs');
+
+// Handlebars
+Handlebars.registerPartial('header', fs.readFileSync(__dirname + '/templates/partials/header.hbt').toString());
+Handlebars.registerPartial('footer', fs.readFileSync(__dirname + '/templates/partials/footer.hbt').toString());
+
+// Gulp tasks
+gulp.task('default', function (cb) {
+ runSequence('clean', ['metalsmith', 'less'], cb);
+});
+
+gulp.task('deploy', ['default'], function () {
+ var s3Deploy = s3(require('./.s3.json'));
+ gulp.src("./build/**/*")
+ .pipe(s3Deploy({
+ Bucket: 'mikevalstar.com',
+ ACL: 'public-read'
+ }));
+});
+
+gulp.task('watch', ['connect'], function() {
+ gulp.watch(['./src/**/*', './templates/**/*'], ['metalsmith']);
+ gulp.watch('./less/**/*', ['less']);
+});
+
+gulp.task('connect', function() {
+ connect.server({
+ root: './build',
+ livereload: true
+ });
+});
+
+gulp.task('metalsmith', function() {
+ gulp.src("./src/**/*")
+ .pipe(gulp_front_matter()).on("data", function(file) {
+ assign(file, file.frontMatter);
+ delete file.frontMatter;
+ }).pipe(
+ gulpsmith()
+ .use(collections({
+ page: {
+ pattern: 'pages/*.md'
+ },
+ post: {
+ pattern: 'posts/*.md',
+ sortBy: 'date',
+ reverse: true
+ }
+ }))
+ .use(markdown())
+ .use(templates('handlebars'))
+ .use(permalinks(':collection/:title'))
+ ).pipe(gulp.dest("./build"))
+ .pipe(connect.reload());
+});
+
+gulp.task('less', function () {
+ return gulp.src('./less/*.less')
+ .pipe(less({
+ paths: [path.join(__dirname, 'less', 'includes')]
+ }))
+ .pipe(autoprefixer(
+ {
+ browsers: [
+ '> 1%',
+ 'last 4 versions',
+ 'firefox >= 4',
+ 'safari 7',
+ 'safari 8',
+ 'IE 8',
+ 'IE 9',
+ 'IE 10',
+ 'IE 11'
+ ],
+ cascade: false
+ }
+ ))
+ .pipe(gulp.dest('./build/css'))
+ .pipe(connect.reload());
+});
+
+gulp.task('clean', function() {
+ return gulp.src('./build', {read: false})
+ .pipe(clean());
+});
View
@@ -0,0 +1 @@
+
View
@@ -0,0 +1,66 @@
+html{
+}
+
+body{
+ background: linear-gradient(to right, #4ca8c4 0%,#3cd3cd 100%);
+ margin: 0;
+ padding: 0;
+ font-family: 'Open Sans', Arial, Helvetica, Geneva, sans-serif;
+ font-size: 1.1em;
+}
+
+#container{
+ margin: 16px;
+ min-height: 95vh;
+}
+
+#header{
+ display: -webkit-box;
+ display: flexbox;
+
+ #hleft, #hright{
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ }
+
+ h1{
+ color: white;
+ font-size: 3.5em;
+ margin: 30px 0;
+ text-shadow: 2px 2px rgba(0,0,0,0.3);
+ }
+}
+
+#hleft, #hright{
+ background: white;
+}
+
+#hc{
+ width: 130px;
+ text-align: center;
+}
+
+#content{
+ background: white;
+ padding: 20px 0;
+ min-height: 80vh;
+}
+
+h2{
+ text-align: center;
+ font-size: 2.8em;
+ margin: 0;
+}
+
+h2, h3{
+ color: #444;
+ font-weight: 200;
+}
+
+p{
+ color: #555;
+ line-height: 1.8em;
+}
+
+@import "pages/home.less";
@@ -0,0 +1,5 @@
+#home{
+ max-width: 90%;
+ width: 700px;
+ margin: 20px auto;
+}
View
@@ -0,0 +1,31 @@
+{
+ "name": "MikeValstarBlog",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "author": "Mike Valstar<mikevalstar@gmail.com>",
+ "license": "BSD",
+ "dependencies": {
+ "colors": "^1.0.3",
+ "handlebars": "^3.0.0",
+ "markdown": "^0.5.0",
+ "metalsmith": "^1.3.0",
+ "metalsmith-collections": "^0.7.0",
+ "metalsmith-markdown": "^0.2.1",
+ "metalsmith-permalinks": "^0.4.0",
+ "metalsmith-templates": "^0.6.1"
+ },
+ "devDependencies": {
+ "gulp": "^3.8.11",
+ "gulp-autoprefixer": "^2.1.0",
+ "gulp-clean": "^0.3.1",
+ "gulp-connect": "^2.2.0",
+ "gulp-front-matter": "^1.2.2",
+ "gulp-less": "^3.0.1",
+ "gulp-livereload": "^3.8.0",
+ "gulp-watch": "^4.1.1",
+ "gulpsmith": "^0.5.3",
+ "lodash": "^3.5.0",
+ "run-sequence": "^1.0.2"
+ }
+}
View
@@ -0,0 +1,7 @@
+---
+title: Blog Home
+template: home.hbt
+permalink: false
+---
+
+A new site I'm building, I'm going to build a static site generator and show how to build a website that can withstand any amount of traffic.
View
@@ -0,0 +1,6 @@
+---
+title: Home
+template: home.hbt
+---
+
+An informative article.
View
@@ -0,0 +1,12 @@
+{{> header}}
+
+<div id="home">
+
+ <h2>{{title}}</h2>
+ <article>
+ {{{contents}}}
+ </article>
+
+</div>
+
+{{> footer}}
@@ -0,0 +1,4 @@
+ </div>
+</div>
+</body>
+</html>
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <title>Mike Valstar - {{title}}</title>
+
+ <link rel="stylesheet" href="/css/main.css" />
+
+ <link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
+
+ <meta name="viewport" content="width=device-width">
+</head>
+<body>
+<div id="container">
+ <div id="header">
+ <div id="hleft"></div>
+ <div id="hc">
+ <h1>M</h1>
+ </div>
+ <div id="hright"></div>
+ </div>
+ <div id="content">

0 comments on commit df5a656

Please sign in to comment.