From cb549da26f6bc777ada1a181e1031c4333e3f98d Mon Sep 17 00:00:00 2001 From: Joe Wroten Date: Sun, 7 Aug 2016 13:11:02 -0500 Subject: [PATCH] First commit, basic working metalsmith --- .gitignore | 41 +++++++++++++++++++++++++++++ Makefile | 8 ++++++ Readme.md | 6 +++++ build/app.css | 1 + build/assets | 0 build/index.html | 32 +++++++++++++++++++++++ build/posts/first-post/index.html | 24 +++++++++++++++++ build/posts/fourth-post/index.html | 24 +++++++++++++++++ build/posts/second-post/index.html | 24 +++++++++++++++++ build/posts/third-post/index.html | 24 +++++++++++++++++ index.js | 37 ++++++++++++++++++++++++++ layouts/layout.html | 26 ++++++++++++++++++ layouts/post.html | 23 ++++++++++++++++ node.txt | 42 ++++++++++++++++++++++++++++++ package.json | 19 ++++++++++++++ src/app.scss | 3 +++ src/index.md | 13 +++++++++ src/posts/first-post.md | 7 +++++ src/posts/fourth-post.md | 7 +++++ src/posts/second-post.md | 7 +++++ src/posts/third-post.md | 7 +++++ 21 files changed, 375 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 Readme.md create mode 100644 build/app.css create mode 100644 build/assets create mode 100644 build/index.html create mode 100644 build/posts/first-post/index.html create mode 100644 build/posts/fourth-post/index.html create mode 100644 build/posts/second-post/index.html create mode 100644 build/posts/third-post/index.html create mode 100644 index.js create mode 100644 layouts/layout.html create mode 100644 layouts/post.html create mode 100644 node.txt create mode 100644 package.json create mode 100644 src/app.scss create mode 100644 src/index.md create mode 100644 src/posts/first-post.md create mode 100644 src/posts/fourth-post.md create mode 100644 src/posts/second-post.md create mode 100644 src/posts/third-post.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..107ffa3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# Created by https://www.gitignore.io/api/node + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8d02552 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ + +build: node_modules + node index.js + +node_modules: package.json + npm install + +.PHONY: build diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..70c7291 --- /dev/null +++ b/Readme.md @@ -0,0 +1,6 @@ + +# Joe Wroten's Portfolio + +``` +make build +``` diff --git a/build/app.css b/build/app.css new file mode 100644 index 0000000..a293e71 --- /dev/null +++ b/build/app.css @@ -0,0 +1 @@ +body{background:yellow} diff --git a/build/assets b/build/assets new file mode 100644 index 0000000..e69de29 diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000..1e1d436 --- /dev/null +++ b/build/index.html @@ -0,0 +1,32 @@ + + + + + Joe Wroten + + + + +
+

+ Home +

+
+

Joe Wroten

+

+ +

TODO

+ +

First post

+

Second post

+

Third post

+

Fourth post

+ + + + + + + diff --git a/build/posts/first-post/index.html b/build/posts/first-post/index.html new file mode 100644 index 0000000..7559e61 --- /dev/null +++ b/build/posts/first-post/index.html @@ -0,0 +1,24 @@ + + + + + My First Post + + + +
+

+ Home +

+ +
+

My First Post

+ +

An interesting post about how it's going to be different this time around. I'm going to write a lot more nowadays and use this blog to improve my writing.

+ + + + + diff --git a/build/posts/fourth-post/index.html b/build/posts/fourth-post/index.html new file mode 100644 index 0000000..6695d1e --- /dev/null +++ b/build/posts/fourth-post/index.html @@ -0,0 +1,24 @@ + + + + + My Fourth Post + + + +
+

+ Home +

+ +
+

My Fourth Post

+ +

A really short, rushed-feeling string of words.

+ + + + + diff --git a/build/posts/second-post/index.html b/build/posts/second-post/index.html new file mode 100644 index 0000000..5ff3eb8 --- /dev/null +++ b/build/posts/second-post/index.html @@ -0,0 +1,24 @@ + + + + + My Second Post + + + +
+

+ Home +

+ +
+

My Second Post

+ +

A super-interesting piece of prose I have already written weeks ago.

+ + + + + diff --git a/build/posts/third-post/index.html b/build/posts/third-post/index.html new file mode 100644 index 0000000..40f1784 --- /dev/null +++ b/build/posts/third-post/index.html @@ -0,0 +1,24 @@ + + + + + My Third Post + + + +
+

+ Home +

+ +
+

My Third Post

+ +

A slightly late, less interesting piece of prose.

+ + + + + diff --git a/index.js b/index.js new file mode 100644 index 0000000..6b87bd5 --- /dev/null +++ b/index.js @@ -0,0 +1,37 @@ +var Metalsmith = require('metalsmith'); +var markdown = require('metalsmith-markdown'); +var sass = require('metalsmith-sass'); +var layouts = require('metalsmith-layouts'); +var permalinks = require('metalsmith-permalinks'); +var serve = require('metalsmith-serve'); +var watch = require('metalsmith-watch'); + +Metalsmith(__dirname) + .metadata({ + title: "Joe Wroten", + description: "", + generator: "Metalsmith", + url: "http://www.metalsmith.io/" + }) + .source('./src') + .destination('./build') + .clean(false) + .use(markdown()) + .use(permalinks()) + .use(sass()) + .use(layouts({ + engine: 'handlebars' + })) + .use(serve()) + .use( + watch({ + paths: { + "src/**/*": true, + "layouts/**/*": true + }, + livereload: true, + }) + ) + .build(function(err, files) { + if (err) { throw err; } + }); diff --git a/layouts/layout.html b/layouts/layout.html new file mode 100644 index 0000000..abe5c56 --- /dev/null +++ b/layouts/layout.html @@ -0,0 +1,26 @@ + + + + + {{ title }} + + + + +
+

+ Home +

+
+

{{ title }}

+

{{ description }}

+ + {{{ contents }}} + + + + + + diff --git a/layouts/post.html b/layouts/post.html new file mode 100644 index 0000000..c8da1f9 --- /dev/null +++ b/layouts/post.html @@ -0,0 +1,23 @@ + + + + + {{ title }} + + + +
+

+ Home +

+ +
+

{{ title }}

+ + {{{ contents }}} + + + + diff --git a/node.txt b/node.txt new file mode 100644 index 0000000..30237ea --- /dev/null +++ b/node.txt @@ -0,0 +1,42 @@ + +# Created by https://www.gitignore.io/api/node + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/package.json b/package.json new file mode 100644 index 0000000..9a90d59 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "static-site-example", + "private": true, + "scripts": { + "build": "make build" + }, + "dependencies": { + "handlebars": "^4.0.5", + "metalsmith": "^2.1.0", + "metalsmith-layouts": "^1.4.1", + "metalsmith-markdown": "^0.2.1", + "metalsmith-permalinks": "^0.5.0" + }, + "devDependencies": { + "metalsmith-sass": "^1.3.0", + "metalsmith-serve": "0.0.7", + "metalsmith-watch": "^1.0.3" + } +} diff --git a/src/app.scss b/src/app.scss new file mode 100644 index 0000000..7936173 --- /dev/null +++ b/src/app.scss @@ -0,0 +1,3 @@ +body { + background: yellow; +} diff --git a/src/index.md b/src/index.md new file mode 100644 index 0000000..9999a8e --- /dev/null +++ b/src/index.md @@ -0,0 +1,13 @@ +--- +layout: layout.html +--- + +

TODO

+ +First post + +Second post + +Third post + +Fourth post diff --git a/src/posts/first-post.md b/src/posts/first-post.md new file mode 100644 index 0000000..62ad941 --- /dev/null +++ b/src/posts/first-post.md @@ -0,0 +1,7 @@ +--- +title: My First Post +date: 2012-08-20 +layout: post.html +--- + +An interesting post about how it's going to be different this time around. I'm going to write a lot more nowadays and use this blog to improve my writing. diff --git a/src/posts/fourth-post.md b/src/posts/fourth-post.md new file mode 100644 index 0000000..4dbbd98 --- /dev/null +++ b/src/posts/fourth-post.md @@ -0,0 +1,7 @@ +--- +title: My Fourth Post +date: 2012-12-07 +layout: post.html +--- + +A really short, rushed-feeling string of words. diff --git a/src/posts/second-post.md b/src/posts/second-post.md new file mode 100644 index 0000000..97742d5 --- /dev/null +++ b/src/posts/second-post.md @@ -0,0 +1,7 @@ +--- +title: My Second Post +date: 2012-08-23 +layout: post.html +--- + +A super-interesting piece of prose I have already written weeks ago. diff --git a/src/posts/third-post.md b/src/posts/third-post.md new file mode 100644 index 0000000..f36e1ce --- /dev/null +++ b/src/posts/third-post.md @@ -0,0 +1,7 @@ +--- +title: My Third Post +date: 2012-09-28 +layout: post.html +--- + +A slightly late, less interesting piece of prose.