1
1
Fork 0

First commit, basic working metalsmith

This commit is contained in:
Joe Wroten 2016-08-07 13:11:02 -05:00
commit cb549da26f
21 changed files with 375 additions and 0 deletions

41
.gitignore vendored Normal file
View file

@ -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

8
Makefile Normal file
View file

@ -0,0 +1,8 @@
build: node_modules
node index.js
node_modules: package.json
npm install
.PHONY: build

6
Readme.md Normal file
View file

@ -0,0 +1,6 @@
# Joe Wroten's Portfolio
```
make build
```

1
build/app.css Normal file
View file

@ -0,0 +1 @@
body{background:yellow}

0
build/assets Normal file
View file

32
build/index.html Normal file
View file

@ -0,0 +1,32 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Joe Wroten</title>
<link href="app.css" type="text/css" rel="stylesheet" />
<meta name="description" content="">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>Joe Wroten</h1>
<p></p>
<h1>TODO</h1>
<p><a href="/posts/first-post/">First post</a></p>
<p><a href="/posts/second-post/">Second post</a></p>
<p><a href="/posts/third-post/">Third post</a></p>
<p><a href="/posts/fourth-post/">Fourth post</a></p>
<footer>
<p>Generated with Metalsmith &mdash; <a href="http://www.metalsmith.io/">http://www.metalsmith.io/</a></p>
</footer>
<script src="http://localhost:35729/livereload.js"></script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My First Post</title>
<meta name="description" content="">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>My First Post</h1>
<time>Sun Aug 19 2012 19:00:00 GMT-0500 (CDT)</time>
<p>An interesting post about how it&#39;s going to be different this time around. I&#39;m going to write a lot more nowadays and use this blog to improve my writing.</p>
<footer>
<p>Generated with Metalsmith &mdash; <a href="http://www.metalsmith.io/">http://www.metalsmith.io/</a></p>
</footer>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My Fourth Post</title>
<meta name="description" content="">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>My Fourth Post</h1>
<time>Thu Dec 06 2012 18:00:00 GMT-0600 (CST)</time>
<p>A really short, rushed-feeling string of words.</p>
<footer>
<p>Generated with Metalsmith &mdash; <a href="http://www.metalsmith.io/">http://www.metalsmith.io/</a></p>
</footer>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My Second Post</title>
<meta name="description" content="">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>My Second Post</h1>
<time>Wed Aug 22 2012 19:00:00 GMT-0500 (CDT)</time>
<p>A super-interesting piece of prose I have already written weeks ago.</p>
<footer>
<p>Generated with Metalsmith &mdash; <a href="http://www.metalsmith.io/">http://www.metalsmith.io/</a></p>
</footer>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My Third Post</title>
<meta name="description" content="">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>My Third Post</h1>
<time>Thu Sep 27 2012 19:00:00 GMT-0500 (CDT)</time>
<p>A slightly late, less interesting piece of prose.</p>
<footer>
<p>Generated with Metalsmith &mdash; <a href="http://www.metalsmith.io/">http://www.metalsmith.io/</a></p>
</footer>
</body>
</html>

37
index.js Normal file
View file

@ -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; }
});

26
layouts/layout.html Normal file
View file

@ -0,0 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{ title }}</title>
<link href="app.css" type="text/css" rel="stylesheet" />
<meta name="description" content="{{ description }}">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>{{ title }}</h1>
<p>{{ description }}</p>
{{{ contents }}}
<footer>
<p>Generated with {{ generator }} &mdash; <a href="{{ url }}">{{ url }}</a></p>
</footer>
<script src="http://localhost:35729/livereload.js"></script>
</body>
</html>

23
layouts/post.html Normal file
View file

@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
</head>
<body>
<header>
<p>
<a href="/">Home</a>
</p>
</header>
<h1>{{ title }}</h1>
<time>{{ date }}</time>
{{{ contents }}}
<footer>
<p>Generated with {{ generator }} &mdash; <a href="{{ url }}">{{ url }}</a></p>
</footer>
</body>
</html>

42
node.txt Normal file
View file

@ -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

19
package.json Normal file
View file

@ -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"
}
}

3
src/app.scss Normal file
View file

@ -0,0 +1,3 @@
body {
background: yellow;
}

13
src/index.md Normal file
View file

@ -0,0 +1,13 @@
---
layout: layout.html
---
<h1>TODO</h1>
<a href="/posts/first-post/">First post</a>
<a href="/posts/second-post/">Second post</a>
<a href="/posts/third-post/">Third post</a>
<a href="/posts/fourth-post/">Fourth post</a>

7
src/posts/first-post.md Normal file
View file

@ -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.

7
src/posts/fourth-post.md Normal file
View file

@ -0,0 +1,7 @@
---
title: My Fourth Post
date: 2012-12-07
layout: post.html
---
A really short, rushed-feeling string of words.

7
src/posts/second-post.md Normal file
View file

@ -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.

7
src/posts/third-post.md Normal file
View file

@ -0,0 +1,7 @@
---
title: My Third Post
date: 2012-09-28
layout: post.html
---
A slightly late, less interesting piece of prose.