Commit 67604104 authored by cgm616's avatar cgm616

Initial commit

parents
*.swp
build/
node_modules/
build: node_modules
node index.js
node_modules: package.json
npm install
.PHONY: build
var Metalsmith = require('metalsmith');
var markdown = require('metalsmith-markdown');
var layouts = require('metalsmith-layouts');
var permalinks = require('metalsmith-permalinks');
var autoprefixer = require('metalsmith-autoprefixer');
var collections = require('metalsmith-collections');
var drafts = require('metalsmith-drafts');
var updated = require('metalsmith-updated');
var feed = require('metalsmith-feed');
var watch = require('metalsmith-watch');
var serve = require('metalsmith-serve');
var minifier = require('metalsmith-html-minifier');
var typography = require('metalsmith-typography');
var branch = require('metalsmith-branch');
var inline = require('metalsmith-inline-source');
var anchors = require("metalsmith-headings-identifier");
var wordcount = require("metalsmith-word-count");
var nested = require('metalsmith-nested');
var writemetadata = require('metalsmith-writemetadata');
var dates = require('metalsmith-date-formatter');
var fs = require('fs')
var path = require('path')
Metalsmith(__dirname) // instantiate Metalsmith in the cwd
.metadata({
title: "cgm616",
description: "This is a website.",
site: {
url: "localhost:8080",
},
})
.source('./src') // specify source directory
.destination('./build') // specify destination directory
.use(watch({
paths: {
"nested/**/*": "**/*.md",
"${source}/**/*": true,
},
})
)
.use(serve())
.use(drafts())
.use(collections({
articles: 'articles/*.md'
}))
.use(markdown())
.use(updated())
.use(dates({
dates: [
{
key: 'created',
format: 'MMMM Do YYYY'
}
]
}))
.use(wordcount())
.use(feed({
collection: 'articles'
}))
.use(permalinks())
.use(nested())
.use(layouts({ // wrap a handlebars-layout
engine: 'handlebars' // around transpiled html-files
}))
.use(branch('index.html').use(inline({
compress: true,
rootpath: path.resolve('src/'),
})))
// .use(writemetadata({
// pattern: ['**/*.md', '**/*.html']
// , ignorekeys: ['next', 'previous']
// , bufferencoding: 'utf8' // also put 'content' into .json
// }))
.use(anchors())
.use(autoprefixer())
.use(minifier())
.build(function(err) { // this is the actual build process
if (err) throw err; // throwing errors is required
});
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<link inline rel="stylesheet" type="text/css" href="/css/main.css">
</head>
<body>
<header>
<pre class="ascii"><a class="main" href="/">
.d8888b. d888 .d8888b.
d88P Y88b d8888 d88P Y88b
888 888 888
.d8888b .d88b. 88888b.d88b. 888d888b. 888 888d888b.
d88P" d88P"88b 888 "888 "88b 888P "Y88b 888 888P "Y88b
888 888 888 888 888 888 888 888 888 888 888
Y88b. Y88b 888 888 888 888 Y88b d88P 888 Y88b d88P
"Y8888P "Y88888 888 888 888 "Y8888P" 8888888 "Y8888P"
888
Y8b d88P
"Y88P"
</a></pre>
</header>
<div class="line"></div>
<ul class="post-list">
{{#each collections.articles }}
<li><a href="/{{ this.path }}">{{ this.created }}: {{ this.title }}</a></li>
{{/each }}
</ul>
<div class="line"></div>
<h1 class="title">{{ title }}</h1>
<div class="info">
<ul class="flat-list">
<li>created on {{ created }}</li>
<li>{{ wordCount }} words</li>
<li>{{ readingTime }} long</li>
</ul>
</div>
<article>
{{{ contents }}}
</article>
<div class="line"></div>
<footer>
(c) 2017 cgm616
</footer>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<link inline rel="stylesheet" type="text/css" href="/css/main.css">
</head>
<body>
<header>
<pre class="ascii"><a class="main" href="/">
.d8888b. d888 .d8888b.
d88P Y88b d8888 d88P Y88b
888 888 888
.d8888b .d88b. 88888b.d88b. 888d888b. 888 888d888b.
d88P" d88P"88b 888 "888 "88b 888P "Y88b 888 888P "Y88b
888 888 888 888 888 888 888 888 888 888 888
Y88b. Y88b 888 888 888 888 Y88b d88P 888 Y88b d88P
"Y8888P "Y88888 888 888 888 "Y8888P" 8888888 "Y8888P"
888
Y8b d88P
"Y88P"
</a></pre>
</header>
<div class="line"></div>
<ul class="post-list">
{{#each collections.articles }}
<li><a href="/{{ this.path }}">{{ this.created }}: {{ this.title }}</a></li>
{{/each }}
</ul>
<div class="line"></div>
{{{ contents }}}
<div class="line"></div>
<footer>
(c) 2017 cgm616
</footer>
</body>
</html>
---
layout: layout.html
---
<h1 class="title">{{ title }}</h1>
<div class="info">
<ul class="flat-list">
<li>created on {{ created }}</li>
<li>{{ wordCount }} words</li>
<li>{{ readingTime }} long</li>
</ul>
</div>
<article>
{{{ contents }}}
</article>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<link inline rel="stylesheet" type="text/css" href="/css/main.css">
</head>
<body>
<header>
<pre class="ascii"><a class="main" href="/">
.d8888b. d888 .d8888b.
d88P Y88b d8888 d88P Y88b
888 888 888
.d8888b .d88b. 88888b.d88b. 888d888b. 888 888d888b.
d88P" d88P"88b 888 "888 "88b 888P "Y88b 888 888P "Y88b
888 888 888 888 888 888 888 888 888 888 888
Y88b. Y88b 888 888 888 888 Y88b d88P 888 Y88b d88P
"Y8888P "Y88888 888 888 888 "Y8888P" 8888888 "Y8888P"
888
Y8b d88P
"Y88P"
</a></pre>
</header>
<div class="line"></div>
<ul class="post-list">
{{#each collections.articles }}
<li><a href="/{{ this.path }}">{{ this.created }}: {{ this.title }}</a></li>
{{/each }}
</ul>
<div class="line"></div>
{{{ contents }}}
<div class="line"></div>
<footer>
(c) 2017 cgm616
</footer>
</body>
</html>
{
"index.html": {
"filename": "index.html",
"hash": "b0e374d51b37a24007d5ceaca3cc06ef",
"created": "2017-07-25T17:02:09.483Z",
"updated": "2017-07-25T17:02:09.483Z"
},
"articles/first.html": {
"filename": "articles/first.html",
"hash": "c14ca590b297c9dd824494f36b21c603",
"created": "2017-07-25T17:02:09.483Z",
"updated": "2017-07-25T17:02:09.483Z"
},
".index.md.swp": {
"filename": ".index.md.swp",
"hash": "7383b6989ca1483f775f62244739d14b",
"created": "2017-07-25T17:03:54.989Z",
"updated": "2017-07-25T17:03:54.989Z"
},
"articles/.first.md.swp": {
"filename": "articles/.first.md.swp",
"hash": "1906a0da3d2417686d0f593465c87582",
"created": "2017-07-25T17:03:54.989Z",
"updated": "2017-07-25T17:03:54.989Z"
},
"css/.main.css.swp": {
"filename": "css/.main.css.swp",
"hash": "3cc06ed9801f8b3a8c910006290a2a15",
"created": "2017-07-25T17:03:54.989Z",
"updated": "2017-07-25T17:03:54.989Z"
},
"css/main.css": {
"filename": "css/main.css",
"hash": "cc2ccd9547ca8e489cf5491c32a8b69c",
"created": "2017-07-25T17:03:54.989Z",
"updated": "2017-07-25T17:03:54.989Z"
}
}
---
title: Testing article
layout: article.html
collection: articles
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eget interdum sapien. Morbi ultrices facilisis libero, ac cursus erat mollis et. Pellentesque efficitur orci eu lobortis imperdiet. In imperdiet ante sit amet purus lobortis ornare. Donec pharetra ligula a fermentum molestie. Morbi sagittis, leo a auctor venenatis, nulla quam tincidunt dolor, id vulputate odio nisl eget ex. Nullam dignissim ullamcorper efficitur. Nam aliquet varius metus, nec efficitur felis lacinia vel.
Fusce sed sagittis magna, id suscipit odio. Sed aliquam ex felis, et egestas metus placerat ut. Duis posuere turpis non pulvinar tempus. Nulla vel diam elementum, tempus elit sit amet, congue magna. Donec sapien lorem, sollicitudin sit amet molestie eget, elementum id ex. Duis non ligula nec nisi fringilla rutrum vitae at mauris. Nullam imperdiet cursus turpis, ac accumsan sem aliquam ut. Sed vel lacinia tellus, quis gravida tortor. Quisque nec mollis odio. Suspendisse potenti.
Suspendisse lobortis tellus eu elementum faucibus. Maecenas ultricies ex scelerisque malesuada tempor. Ut molestie neque ac lorem tincidunt porta. Praesent et dignissim diam. Aenean accumsan felis dolor, at vehicula odio venenatis id. Fusce sed est ultricies, faucibus velit sit amet, tempus neque. Donec a eros et urna posuere mattis. In facilisis ligula risus. Cras eget sem ornare nisl gravida tincidunt sed eu elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam volutpat semper massa sed dictum. Quisque tempus sagittis tortor, id congue tortor fringilla quis. Nulla posuere tellus leo, sit amet sodales nulla sagittis ut.
Pellentesque ut metus quis massa molestie lobortis in dignissim leo. Donec sodales enim ut tempus faucibus. Quisque eget ante ac risus gravida blandit. Nulla dapibus orci sed sagittis pharetra. Donec diam felis, sollicitudin ut sem a, mollis euismod augue. Suspendisse blandit finibus diam non pellentesque. Proin mattis tortor nec vulputate euismod. Donec bibendum ligula non nulla suscipit laoreet. Fusce iaculis, metus in interdum pellentesque, nunc metus fringilla dolor, id pharetra felis erat sit amet ante. In vitae tempor leo, a condimentum sapien. Ut ac eros a libero fringilla tempus varius in orci. Pellentesque nec scelerisque elit. Pellentesque arcu enim, pellentesque vel metus eu, faucibus fermentum est. Aenean viverra tempus leo id pretium.
Curabitur vitae lacus vel metus viverra aliquam. Fusce fringilla tristique metus eu lacinia. Quisque elit augue, rhoncus nec dignissim in, pretium sed enim. Fusce ut pretium mauris. Sed vitae ipsum eget massa molestie ultricies suscipit ut magna. Etiam posuere, diam ac congue pretium, enim felis rhoncus orci, nec facilisis lorem risus sed nunc. Nam cursus sapien eu nulla euismod imperdiet. Mauris facilisis, urna in consequat fringilla, lorem felis pellentesque felis, vel mattis tellus ipsum eu magna. Sed consequat non ante id tempor. Vestibulum tincidunt semper libero et varius. Praesent sit amet erat consectetur, lobortis sem quis, mollis leo. Fusce in elit et odio cursus feugiat. Nam id lorem sollicitudin, ullamcorper diam ac, mollis velit. Donec et nisl in nulla ornare semper. Phasellus sed tincidunt sem.
body {
margin: 1rem auto;
max-width: 40rem;
padding: 0 0.62rem;
font-family: Georgia, serif;
font-size: 1.2rem;
line-height: 1.6rem;
background-color: #ffe8c2;
color: #000000;
}
.post-list {
list-style-type: none;
padding-left: 0;
}
a {
text-decoration: none;
}
a:link {
color: #cf5c36;
}
a:visited {
color: #f0a868;
}
.info {
font-size: 1.0rem;
font-style: italic;
margin-top: 0;
margin-bottom: 1.0rem;
}
.flat-list {
list-style-type: none;
display: inline;
margin: 0;
padding-left: 0;
}
.flat-list li {
display: inline-block;
padding-right: 1rem;
white-space: nowrap;
}
h1.title {
font-variant: small-caps;
margin-bottom: 0.8rem;
}
h1, h2, h3 {
line-height: 1.2rem;
}
.ascii {
font-family: monospace;
font-size: 0.6rem;
line-height: 0.6rem;
white-space: pre;
margin: 3rem auto 1rem auto;
}
.line {
width: 97%;
height: 2px;
background-color: #7c7c7c;
}
@media print {
body {
max-width: none;
}
}
footer {
font-size: 0.9rem;
margin-top: 0.8rem;
}
---
layout: layout.html
---
This is the index page.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment