initial commit

This commit is contained in:
readme 2020-03-02 20:30:38 +01:00
commit 9169024ff0
60 changed files with 8596 additions and 0 deletions

9
.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
.DS_Store
Thumbs.db
.npm
.vscode
node_modules
npm-debug.log*
logs
*.log

45
README.md Normal file
View file

@ -0,0 +1,45 @@
# dashdev-website
A website created using the Node.js Metalsmith static site generator.
## Installation
Please ensure [Node.js](https://nodejs.org/) and [Git](https://git-scm.com/) are installed on your system.
Download the demonstration code and switch to directory:
```bash
git clone git@github.com:dashdev-suite/dashdev-website.git
cd dashdev-website
```
Install dependencies:
```bash
npm install
```
## Build the static site
To build and launch the site using [Browsersync](https://www.browsersync.io/):
```bash
npm start
```
(Stop the server with `Ctrl+C`.)
To build the site for production and compress HTML files:
```bash
npm run production
```
The site is built in the `/build` folder.
## Further information
The [built site](https://rawgit.com/dashdev-suite/dashdev-website/master/build/) provides further information about site files and settings.

144
build-old.js Normal file
View file

@ -0,0 +1,144 @@
#!/usr/bin/env node
/*
Metalsmith build file
Build site with `node ./build.js` or `npm start`
Build production site with `npm run production`
*/
'use strict';
var
// defaults
consoleLog = false, // set true for metalsmith file and meta content logging
devBuild = ((process.env.NODE_ENV || '').trim().toLowerCase() !== 'production'),
pkg = require('./package.json'),
// main directories
dir = {
base: __dirname + '/',
lib: __dirname + '/lib/',
source: './src/',
dest: './build/'
},
// modules
metalsmith = require('metalsmith'),
markdown = require('metalsmith-markdown'),
publish = require('metalsmith-publish'),
wordcount = require("metalsmith-word-count"),
collections = require('metalsmith-collections'),
permalinks = require('metalsmith-permalinks'),
// jstransformer = require('metalsmith-jstransformer'),
inplace = require('metalsmith-in-place'),
layouts = require('metalsmith-layouts'),
sitemap = require('metalsmith-mapsite'),
rssfeed = require('metalsmith-feed'),
assets = require('metalsmith-assets'),
htmlmin = devBuild ? null : require('metalsmith-html-minifier'),
browsersync = devBuild ? require('metalsmith-browser-sync') : null,
// handlebars = require('jstransformer')(require('jstransformer-handlebars')),
// custom plugins
setdate = require(dir.lib + 'metalsmith-setdate'),
moremeta = require(dir.lib + 'metalsmith-moremeta'),
debug = consoleLog ? require(dir.lib + 'metalsmith-debug') : null,
siteMeta = {
devBuild: devBuild,
version: pkg.version,
name: 'dashdev-website',
desc: 'metalsmith website',
author: 'dashdevs',
contact: 'https://chat.dashdevs.org',
domain: devBuild ? 'http://127.0.0.1' : 'https://rawgit.com', // set domain
rootpath: devBuild ? null : '/dashdev-suite/dashdev-website/master/build/' // set absolute path (null for relative)
},
templateConfig = {
engine: 'handlebars',
directory: 'template/',
partials: 'partials/',
default: 'page.html'
};
console.log((devBuild ? 'Development' : 'Production'), 'build, version', pkg.version);
var ms = metalsmith(dir.base)
.clean(!devBuild) // clean folder before a production build
.source(dir.source + 'html/') // source folder (src/html/)
.destination(dir.dest) // build folder (build/)
.metadata(siteMeta) // add meta data to every page
.use(publish()) // draft, private, future-dated
.use(setdate()) // set date on every page if not set in front-matter
.use(collections({ // determine page collection/taxonomy
page: {
pattern: '**/index.*',
sortBy: 'priority',
reverse: true,
refer: false
},
start: {
pattern: 'start/**/*',
sortBy: 'priority',
reverse: true,
refer: true,
metadata: {
layout: 'article.html'
}
},
article: {
pattern: 'article/**/*',
sortBy: 'date',
reverse: true,
refer: true,
limit: 50,
metadata: {
layout: 'article.html'
}
}
}))
.use(markdown()) // convert markdown
.use(permalinks({ // generate permalinks
pattern: ':mainCollection/:title'
}))
.use(wordcount({
raw: true
})) // word count
.use(moremeta()) // determine root paths and navigation
// .use(jstransformer({
// 'pattern': '**',
// 'layoutPattern': './src/html/**',
// 'defaultLayout': null
// }))
.use(inplace(templateConfig)) // in-page templating
.use(layouts(templateConfig)); // layout templating
if (htmlmin) ms.use(htmlmin()); // minify production HTML
if (debug) ms.use(debug()); // output page debugging information
if (browsersync) ms.use(browsersync({ // start test server
server: dir.dest,
files: [dir.source + '**/*']
}));
ms
.use(sitemap({ // generate sitemap.xml
hostname: siteMeta.domain + (siteMeta.rootpath || ''),
omitIndex: true
}))
.use(rssfeed({ // generate RSS feed for articles
collection: 'article',
site_url: siteMeta.domain + (siteMeta.rootpath || ''),
title: siteMeta.name,
description: siteMeta.desc
}))
.use(assets({ // copy assets: CSS, images etc.
source: dir.source + 'assets/',
destination: './'
}))
.build(function (err) { // build
if (err) throw err;
});

150
build.js Normal file
View file

@ -0,0 +1,150 @@
#!/usr/bin/env node
// defaults
var consoleLog = false; // set true for metalsmith file and meta content logging
var devBuild = ((process.env.NODE_ENV || '').trim().toLowerCase() !== 'production');
var pkg = require('./package.json');
// main directories
dir = {
base: __dirname + '/',
lib: __dirname + '/lib/',
source: './src/',
dest: './build/'
};
siteMeta = {
devBuild: devBuild,
version: pkg.version,
name: 'dashdev-website',
desc: 'metalsmith website',
author: 'dashdevs',
contact: 'https://chat.dashdevs.org',
domain: devBuild ? 'http://127.0.0.1' : 'https://rawgit.com', // set domain
rootpath: devBuild ? null : '/dashdev-suite/dashdev-website/master/build/' // set absolute path (null for relative)
};
templateConfig = {
engine: 'handlebars',
directory: 'template/',
partials: 'partials/',
default: 'page.html'
};
// metalsmith
var Metalsmith = require('metalsmith');
// modules
var markdown = require('metalsmith-markdown');
var markdownPrecompiler = require('metalsmith-markdown-precompiler');
var collections = require('metalsmith-collections');
var permalinks = require('metalsmith-permalinks');
var inplace = require('metalsmith-in-place');
var layouts = require('metalsmith-layouts');
var discoverPartials = require('metalsmith-discover-partials');
var paths = require('metalsmith-paths');
var sitemap = require('metalsmith-sitemap');
var assets = require('metalsmith-assets');
var browsersync = devBuild ? require('metalsmith-browser-sync') : null;
moremeta = require(dir.lib + 'metalsmith-moremeta');
console.log((devBuild ? 'Development' : 'Production'), 'build, version', pkg.version);
// instantiate
var metalsmith = Metalsmith(__dirname)
.clean(true) // clean folder before a production build
.source(dir.source + 'html/') // source folder (src/)
.destination(dir.dest) // build folder (build/)
.metadata(siteMeta) // add meta data to every page
.use(discoverPartials({ // needed for markdownPrecompiler
directory: 'partials',
pattern: /\.hbs$/ // original partials .html but exactly these parameters work
}))
// .use(json_to_files({
// source_path: './box/'
// }))
.use(paths())
.use(collections({ // determine page collection/taxonomy
page: {
pattern: '**/index.*',
sortBy: 'priority',
reverse: true,
refer: false
},
start: {
pattern: 'start/**/*',
sortBy: 'priority',
reverse: true,
refer: true,
metadata: {
layout: 'article.hbs'
}
},
article: {
pattern: 'article/**/*',
sortBy: 'date',
reverse: true,
refer: true,
limit: 50,
metadata: {
layout: 'article.hbs'
}
}
}))
.use(markdownPrecompiler({ // convert {{> navmain}} in header.html
engine: "handlebars",
pattern: /\.md$/, // regex; no idea why .md works, check discoverPartials above
partialsPath: './../partials',
partials: ['navmain', 'navsub', 'footer', 'header', 'meta', 'pagelist']
// partials: ['partial']
}))
.use(markdown()) // convert markdown
.use(permalinks({ // generate permalinks
pattern: ':mainCollection/:title'
}))
.use(moremeta()) // determine root paths and navigation, TODO check remove
// .use(inplace({
// //engineOptions: {},
// pattern: `partials.hbs/**`
// }))
.use(layouts({
//engineOptions: {},
pattern: `**/index.*`,
default: 'page.hbs'
}))
// .use(layouts({
// //engineOptions: {},
// pattern: `start/**`,
// default: 'article.hbs'
// }))
// .use(layouts({
// //engineOptions: {},
// pattern: `article/**`,
// default: 'article.hbs'
// }))
// if (debug) metalsmith.use(debug()); // output page debugging information
if (browsersync) metalsmith.use(browsersync({ // start test server
server: dir.dest,
files: [dir.source + '**/*']
}));
metalsmith
.use(sitemap({ // generate sitemap.xml
hostname: siteMeta.domain + (siteMeta.rootpath || ''),
omitIndex: true
}))
.use(assets({ // copy assets: CSS, images etc.
source: dir.source + 'assets/',
destination: './'
}))
.build(function (err) {
if (err) throw err;
});

View file

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Draft article - dashdev-website</title>
<meta name="description" content="An unpublished article." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/">Start</a>
</li>
<li>
<a href="../../article/" class="active">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Draft article</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>This is a draft article.</p>
<p>It will never appear in the site unless the <code>publish</code> front-matter is set to <code>published</code> or a date which has passed.</p>
<nav class="nav page">
<ul>
<li><a href="../../article/future/" class="back">&laquo; back: Future publication</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../article/usage/">Usage options</a>
</li>
<li>
<a href="../../article/gotchas/">Gotchas</a>
</li>
<li>
<a href="../../article/gulp/">Gulp</a>
</li>
<li>
<a href="../../article/future/">Future publication</a>
</li>
<li>
<strong>Draft article</strong>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Future publication - dashdev-website</title>
<meta name="description" content="This article will be published after 1 March, 2016." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/">Start</a>
</li>
<li>
<a href="../../article/" class="active">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Future publication</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>This article will only appear if the site is built is run after 1 March, 2016.</p>
<nav class="nav page">
<ul>
<li><a href="../../article/gulp/" class="back">&laquo; back: Gulp</a></li></p>
<li><a href="../../article/draft/" class="next">next: Draft article &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../article/usage/">Usage options</a>
</li>
<li>
<a href="../../article/gotchas/">Gotchas</a>
</li>
<li>
<a href="../../article/gulp/">Gulp</a>
</li>
<li>
<strong>Future publication</strong>
</li>
<li>
<a href="../../article/draft/">Draft article</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,120 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Gotchas - dashdev-website</title>
<meta name="description" content="Issues and workarounds when using Metalsmith." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/">Start</a>
</li>
<li>
<a href="../../article/" class="active">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Gotchas</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>Not everything is necessarily straight-forward in the Metalsmith world&hellip;</p>
<h2 id="incompatible-plugins">Incompatible plugins</h2>
<p>Some plugins clash with another. For example, <a href="https://github.com/radiovisual/metalsmith-rootpath">metalsmith-rootpath</a> which calculates relative roots does not play nicely with <a href="https://github.com/segmentio/metalsmith-permalinks">metalsmith-permalinks</a> which creates custom folder structures.</p>
<p><em>Note: <code>lib/metalsmith-moremeta</code> in this project sets a correct <code>root</code> variable whether permalinks are used or not.</em></p>
<h2 id="plugin-order-can-be-critical">Plugin order can be critical</h2>
<p>One plugins may depend on another or conflict if placed the wrong way around. For example, the RSS-generating <a href="https://github.com/hurrymaplelad/metalsmith-feed">metalsmith-feed</a> plugin must be called after <a href="https://github.com/superwolff/metalsmith-layouts">metalsmith-layouts</a> to ensure <code>rss.xml</code> is not generated within a page template.</p>
<h2 id="browsersync-build-issues">Browsersync build issues</h2>
<p>When <a href="https://www.browsersync.io/">Browsersync</a> is running and files are edited, collections are re-parsed but the old data remains. This can cause menus and next/back links to be incorrect. To fix this, stop and restart the build.</p>
<nav class="nav page">
<ul>
<li><a href="../../article/usage/" class="back">&laquo; back: Usage options</a></li></p>
<li><a href="../../article/" class="next">next: Articles &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../article/usage/">Usage options</a>
</li>
<li>
<strong>Gotchas</strong>
</li>
<li>
<a href="../../article/gulp/">Gulp</a>
</li>
<li>
<a href="../../article/future/">Future publication</a>
</li>
<li>
<a href="../../article/draft/">Draft article</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,137 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Gulp - dashdev-website</title>
<meta name="description" content="Do you need Gulp? Can it be integrated with Metalsmith?" />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/">Start</a>
</li>
<li>
<a href="../../article/" class="active">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Gulp</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>Metalsmith has plugins for <a href="https://github.com/stevenschobert/metalsmith-sass">CSS pre-processing with Sass</a>, <a href="https://github.com/ahmadnassri/metalsmith-imagemin">image minification</a>, <a href="https://github.com/aymericbeaumet/metalsmith-concat">file concatenation</a>, <a href="https://github.com/ksmithut/metalsmith-uglify">uglification</a> and more. The build code will be familiar to anyone with <a href="http://gulpjs.com/">Gulp</a> experience.</p>
<h2 id="do-you-still-need-gulp">Do you still need Gulp?</h2>
<p>Metalsmith is often enough for simpler workflows. However, Gulp has a more extensive range of plugins and permits complex build activities such as linting and <a href="http://postcss.org/">PostCSS</a> processing with <a href="https://github.com/postcss/autoprefixer">auto-prefixer</a>.</p>
<p>Metalsmith can be used within any Gulp task, e.g.</p>
<pre><code>var
gulp = require(&#39;gulp&#39;),
metalsmith = require(&#39;metalsmith&#39;),
publish = require(&#39;metalsmith-publish&#39;),
markdown = require(&#39;metalsmith-markdown&#39;);
// build HTML files using Metalsmith
gulp.task(&#39;html&#39;, function() {
var ms = metalsmith(dir.base)
.clean(false)
.source(&#39;src/html/&#39;)
.destination(&#39;build&#39;)
.use(publish())
.use(markdown())
.build(function(err) {
if (err) throw err;
});
});</code></pre><p>Further Gulp tasks can then be added. Note <code>.clean(false)</code> ensures Metalsmith never wipes the build folder when other tasks are active.</p>
<p>There are a number of Gulp/Metalsmith integration plugins although they are rarely necessary.</p>
<nav class="nav page">
<ul>
<li><a href="../../article/" class="back">&laquo; back: Articles</a></li></p>
<li><a href="../../article/future/" class="next">next: Future publication &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../article/usage/">Usage options</a>
</li>
<li>
<a href="../../article/gotchas/">Gotchas</a>
</li>
<li>
<strong>Gulp</strong>
</li>
<li>
<a href="../../article/future/">Future publication</a>
</li>
<li>
<a href="../../article/draft/">Draft article</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

150
build/article/index.html Normal file
View file

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Articles - dashdev-website</title>
<meta name="description" content="A set of articles published on this site." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../">Home</a>
</li>
<li>
<a href="../start/">Start</a>
</li>
<li>
<a href="../article/" class="active">Articles</a>
</li>
<li>
<a href="../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Articles</h1>
<p>A selection of articles is available in this section.</p>
<ul class="pagelist">
<li>
<a href="../article/usage/">
<h2>Usage options</h2>
<p class="articleinfo"></p>
<p>What type of project could benefit from Metalsmith?</p>
</a>
</li>
<li>
<a href="../article/gotchas/">
<h2>Gotchas</h2>
<p class="articleinfo"></p>
<p>Issues and workarounds when using Metalsmith.</p>
</a>
</li>
<li>
<a href="../article/gulp/">
<h2>Gulp</h2>
<p class="articleinfo"></p>
<p>Do you need Gulp? Can it be integrated with Metalsmith?</p>
</a>
</li>
<li>
<a href="../article/future/">
<h2>Future publication</h2>
<p class="articleinfo"></p>
<p>This article will be published after 1 March, 2016.</p>
</a>
</li>
<li>
<a href="../article/draft/">
<h2>Draft article</h2>
<p class="articleinfo"></p>
<p>An unpublished article.</p>
</a>
</li>
</ul>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../article/usage/">Usage options</a>
</li>
<li>
<a href="../article/gotchas/">Gotchas</a>
</li>
<li>
<a href="../article/gulp/">Gulp</a>
</li>
<li>
<a href="../article/future/">Future publication</a>
</li>
<li>
<a href="../article/draft/">Draft article</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,120 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Usage options - dashdev-website</title>
<meta name="description" content="What type of project could benefit from Metalsmith?" />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/">Start</a>
</li>
<li>
<a href="../../article/" class="active">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Usage options</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>Metalsmith could be used to create any number of resources, including:</p>
<ul>
<li>a fast static website with minimal server-side requirements</li>
<li>technical documentation</li>
<li>an eBook</li>
<li>application prototypes</li>
<li>build tools or project scaffolding</li>
</ul>
<p>The markdown files can be converted to other files types using plugins such as <a href="https://github.com/arve0/metalsmith-pandoc">metalsmith-pandoc</a> or <a href="https://github.com/jjclark1982/metalsmith-pdf">metalsmith-pdf</a>.</p>
<nav class="nav page">
<ul>
<li><a href="../../article/gotchas/" class="next">next: Gotchas &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<strong>Usage options</strong>
</li>
<li>
<a href="../../article/gotchas/">Gotchas</a>
</li>
<li>
<a href="../../article/gulp/">Gulp</a>
</li>
<li>
<a href="../../article/future/">Future publication</a>
</li>
<li>
<a href="../../article/draft/">Draft article</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

74
build/contact/index.html Normal file
View file

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Contact - dashdev-website</title>
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../">Home</a>
</li>
<li>
<a href="../start/">Start</a>
</li>
<li>
<a href="../article/">Articles</a>
</li>
<li>
<a href="../contact/" class="active">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main>
<div class="content">
<article>
<h1>Contact</h1>
<p>Any questions?</p>
<p>Contact us at <a href="">Dash DApp Developers Discord</a></p>
</article>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, page template</p>
</footer>
</body>
</html>

277
build/css/styles.css Normal file
View file

@ -0,0 +1,277 @@
/* basic page styles */
*, *:before, *:after {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
font-family: georgia, cambria, "times new roman", times, serif;
font-size: 1em;
color: #555;
background-color: #eee;
line-height: 1.5;
}
article, aside, details, figcaption, figure, footer, header, main, nav, section, summary {
display: block;
}
h1, h2, .logo {
font-family: arial, helvetica, free-sans, sans-serif;
font-weight: normal;
}
h1 {
font-size: 1.6em;
}
h2 {
font-size: 1.4em;
margin: 2rem 0 0 0;
}
p {
margin: 0 0 1em 0;
}
ul, ol {
margin: 1em 0 1.5em 3em;
}
li {
margin: 0 0 0.75em 0;
}
img {
float: right;
width: auto;
height: auto;
max-width: 50%;
margin: 0 0 1em 1em;
border: 0 none;
}
pre {
font-size: 0.8rem;
padding: 0.2em 0.4em;
margin: 1em 0 1.5em 3em;
background-color: #eff5ef;
border-radius: 3px;
overflow: auto;
}
code {
font-family: Consolas, Menlo, "DejaVu Mono", monospace;
color: #363;
background-color: #eff5ef;
border-radius: 3px;
padding: 0 0.2em;
}
pre code {
padding: 0;
}
a:link, a:visited {
text-decoration: none;
color: #66c;
}
a:hover, a:active {
color: #c66;
}
.pagelist {
list-style-type: none;
display: flex;
flex-wrap: wrap;
margin: 0;
line-height: 1.3;
}
.pagelist li {
flex: 1 1 45%;
margin: 0 1em 1em 0;
}
.pagelist a {
display: block;
height: 100%;
padding: 5px 10px;
border: 1px solid #ccc;
outline: 0 none;
overflow: hidden;
}
.pagelist a:hover, .pagelist a:focus {
background-color: #f9f9f9;
border-color: #999;
}
.pagelist h2, .pagelist p {
margin: 0;
}
.pagelist p {
color: #333;
}
p.articleinfo {
font-size: 0.8em;
color: #777;
}
/* layout */
.content {
max-width: 50em;
padding: 0 0.5em;
margin: 0 auto;
}
main {
clear: both;
background-color: #fff;
overflow: auto;
}
article {
padding: 1rem 0;
}
header, footer {
clear: both;
width: 100%;
overflow: auto;
background-color: #eee;
}
footer {
font-size: 0.85em;
padding: 1em;
text-align: center;
}
footer p {
margin: 0;
}
.logo {
font-size: 1.5em;
margin: 0.2em 0 0 0;
}
.logo a {
padding: 0.2em 0;
color: #999;
}
/* navigation */
.nav ul {
display: flex;
flex-wrap: wrap;
list-style-type: none;
margin: 0;
}
.nav li {
flex: 1 1 100%;
margin: 0;
}
.nav a, .nav strong {
display: block;
text-align: center;
white-space: nowrap;
padding: 0.6em 0;
}
.nav.main a {
color: #222;
}
.nav a.active, .nav strong {
background-color: #fff;
}
.nav.page {
margin-top: 1.5em;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
@media (min-width: 16em) {
.nav li {
flex: 1 1 50%;
}
}
@media (min-width: 32em) {
header {
position: fixed;
top: 0;
}
.logo {
float: left;
}
.nav.main {
float: right;
}
.nav li {
flex: 1 1 auto;
}
.nav.main li {
width: 6em;
}
main {
padding: 3em 0 2em 0;
}
.subpages .content {
display: flex;
}
.subpages article {
flex: 1 1 70%;
min-width: 0;
}
.subpages .nav.sub {
flex: 1 1 30%;
margin: 0 0 0 2rem;
}
.nav.sub ul {
margin-top: 1em;
flex-direction: column;
border-top: 1px dotted #ccc;
}
.nav.sub li {
border-bottom: 1px dotted #ccc;
}
.nav.sub a, .nav.sub strong {
text-align: left;
padding-left: 0.75em;
}
.nav.page a {
text-align: left;
padding-left: 0.5em;
padding-right: 0.5em;
}
.nav.page a.next {
text-align: right;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
build/images/nodejs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

84
build/index.html Normal file
View file

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>dashdev-website</title>
<meta name="description" content="A static HTML-only website generated using Metalsmith.io." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="" class="active">Home</a>
</li>
<li>
<a href="start/">Start</a>
</li>
<li>
<a href="article/">Articles</a>
</li>
<li>
<a href="contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main>
<div class="content">
<article>
<p><a href="http://dash.org/"><img src="/images/nodejs.png" alt="Node.js"></a></p>
<p>This is a static website generated using the Node.js-powered <strong><a href="http://metalsmith.io">Metalsmith</a></strong> and various published and custom plugins.</p>
<p>This is a demonstration rather than a recommended way to build a static site. Your requirements will be different. Please use any part of the code as you wish.</p>
<h2 id="where-could-you-use-metalsmith">Where could you use Metalsmith?</h2>
<p>Metalsmith could be used to create:</p>
<ul>
<li>a fast static website with minimal server-side requirements</li>
<li>technical documentation</li>
<li>an eBook</li>
<li>application prototypes</li>
<li>build tools or project scaffolding</li>
</ul>
<p><a href="start/">Get started&hellip;</a></p>
</article>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, page template</p>
</footer>
</body>
</html>

17
build/sitemap.xml Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url> <loc>http://127.0.0.1/</loc> <priority>1.0</priority> </url>
<url> <loc>http://127.0.0.1/article/draft/</loc> </url>
<url> <loc>http://127.0.0.1/article/future/</loc> </url>
<url> <loc>http://127.0.0.1/article/gotchas/</loc> </url>
<url> <loc>http://127.0.0.1/article/gulp/</loc> </url>
<url> <loc>http://127.0.0.1/article/</loc> <priority>0.8</priority> </url>
<url> <loc>http://127.0.0.1/article/usage/</loc> </url>
<url> <loc>http://127.0.0.1/contact/</loc> <priority>0.7</priority> </url>
<url> <loc>http://127.0.0.1/start/build/</loc> <priority>0.5</priority> </url>
<url> <loc>http://127.0.0.1/start/</loc> <priority>0.9</priority> </url>
<url> <loc>http://127.0.0.1/start/installation/</loc> <priority>0.5</priority> </url>
<url> <loc>http://127.0.0.1/start/page-definitions/</loc> <priority>0.3</priority> </url>
<url> <loc>http://127.0.0.1/start/plugins/</loc> <priority>0.3</priority> </url>
<url> <loc>http://127.0.0.1/start/site-files/</loc> <priority>0.4</priority> </url>
</urlset>

View file

@ -0,0 +1,117 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Build - dashdev-website</title>
<meta name="description" content="How to build the static site using Metalsmith." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/" class="active">Start</a>
</li>
<li>
<a href="../../article/">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Build</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>To build and launch the site in a test server using <a href="https://www.browsersync.io/">Browsersync</a>:</p>
<pre><code>npm start</code></pre><p>(Stop the server with <code>Ctrl+C</code>.)</p>
<p>To build the site for production and compress HTML files:</p>
<pre><code>npm run production</code></pre><p>The site is built in the <code>/build</code> folder.</p>
<p>Note you may want to change the <code>siteMeta.domain</code> and <code>siteMeta.rootpath</code> on lines 52 and 53 of <code>./build.js</code>.</p>
<nav class="nav page">
<ul>
<li><a href="../../start/installation/" class="back">&laquo; back: Installation</a></li></p>
<li><a href="../../start/site-files/" class="next">next: Site files &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../start/installation/">Installation</a>
</li>
<li>
<strong>Build</strong>
</li>
<li>
<a href="../../start/site-files/">Site files</a>
</li>
<li>
<a href="../../start/page-definitions/">Page definitions</a>
</li>
<li>
<a href="../../start/plugins/">Custom plugins</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

150
build/start/index.html Normal file
View file

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Start - dashdev-website</title>
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../">Home</a>
</li>
<li>
<a href="../start/" class="active">Start</a>
</li>
<li>
<a href="../article/">Articles</a>
</li>
<li>
<a href="../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Start</h1>
<p>This section provides an overview of core code and concepts.</p>
<ul class="pagelist">
<li>
<a href="../start/installation/">
<h2>Installation</h2>
<p class="articleinfo"></p>
<p>How to install this demonstration code.</p>
</a>
</li>
<li>
<a href="../start/build/">
<h2>Build</h2>
<p class="articleinfo"></p>
<p>How to build the static site using Metalsmith.</p>
</a>
</li>
<li>
<a href="../start/site-files/">
<h2>Site files</h2>
<p class="articleinfo"></p>
<p>A description of the source files used to build a website</p>
</a>
</li>
<li>
<a href="../start/page-definitions/">
<h2>Page definitions</h2>
<p class="articleinfo"></p>
<p>How pages are defined in the source folder.</p>
</a>
</li>
<li>
<a href="../start/plugins/">
<h2>Custom plugins</h2>
<p class="articleinfo"></p>
<p>The custom plugins used to create this website.</p>
</a>
</li>
</ul>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../start/installation/">Installation</a>
</li>
<li>
<a href="../start/build/">Build</a>
</li>
<li>
<a href="../start/site-files/">Site files</a>
</li>
<li>
<a href="../start/page-definitions/">Page definitions</a>
</li>
<li>
<a href="../start/plugins/">Custom plugins</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,117 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Installation - dashdev-website</title>
<meta name="description" content="How to install this demonstration code." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/" class="active">Start</a>
</li>
<li>
<a href="../../article/">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Installation</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>Please ensure <a href="https://nodejs.org/">Node.js</a> and <a href="https://git-scm.com/">Git</a> are installed on your system.</p>
<p>Download the demonstration code and switch to directory:</p>
<p> git clone <a href="mailto:git@github.com">git@github.com</a>:dashdev-suite/dashdev-website.git
cd metalsmith-demo</p>
<p>Install dependencies:</p>
<pre><code>npm install</code></pre>
<nav class="nav page">
<ul>
<li><a href="../../start/" class="back">&laquo; back: Start</a></li></p>
<li><a href="../../start/build/" class="next">next: Build &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<strong>Installation</strong>
</li>
<li>
<a href="../../start/build/">Build</a>
</li>
<li>
<a href="../../start/site-files/">Site files</a>
</li>
<li>
<a href="../../start/page-definitions/">Page definitions</a>
</li>
<li>
<a href="../../start/plugins/">Custom plugins</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,131 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page definitions - dashdev-website</title>
<meta name="description" content="How pages are defined in the source folder." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/" class="active">Start</a>
</li>
<li>
<a href="../../article/">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Page definitions</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>Each sub-folder in <code>src/html</code> is a website section. Pages named <code>index.md</code> are the default page in section. File paths are translated to permalinks, e.g.</p>
<pre><code>src/html/article/mypage.md</code></pre><p>is rendered to:</p>
<pre><code>build/article/mypage/index.html</code></pre><p>Pages use YAML front-matter defined at the top. This can be referenced in templates or during the build process, e.g.</p>
<pre><code>---
title: My page title
description: A description of this page for meta tags and page lists.
layout: page.html
priority: 0.9
publish: 2016-06-01
date: 2016-06-01
---</code></pre><p>All items are optional. Note:</p>
<ul>
<li><code>layout</code> defaults to <code>page.html</code> unless <code>metadata.layout</code> is defined for the page collection (see the <code>use(collections({ ... })</code> code in <code>build.js</code>).</li>
<li><code>priority</code> is a number between 0 (low) and 1 (high) which is used to order menus and define XML sitemaps.</li>
<li><code>publish</code> can be set <code>draft</code>, <code>private</code> or a future date to ensure it is not published until required.</li>
<li><code>date</code> is the date of the article. If not set, a future <code>publish</code> date or the file creation date is used.</li>
</ul>
<p>The page content is defined in markdown, HTML syntax or both below the front-matter section. The content can include <a href="http://handlebarsjs.com/">Handlebars</a> partials from the <code>src/partials</code> folder, e.g.</p>
<pre><code>{{&gt; partialname }}</code></pre><p>where <code>partialname</code> is the partial filename without its <code>.html</code> extension.</p>
<nav class="nav page">
<ul>
<li><a href="../../start/site-files/" class="back">&laquo; back: Site files</a></li></p>
<li><a href="../../start/plugins/" class="next">next: Custom plugins &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../start/installation/">Installation</a>
</li>
<li>
<a href="../../start/build/">Build</a>
</li>
<li>
<a href="../../start/site-files/">Site files</a>
</li>
<li>
<strong>Page definitions</strong>
</li>
<li>
<a href="../../start/plugins/">Custom plugins</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Custom plugins - dashdev-website</title>
<meta name="description" content="The custom plugins used to create this website." />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/" class="active">Start</a>
</li>
<li>
<a href="../../article/">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Custom plugins</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>The <code>build.js</code> file defines how the site is built using Metalsmith and various plugins.</p>
<p>Several custom plugins have been created specifically for this site:</p>
<ul>
<li><code>lib/metalsmith-debug.js</code>: output debugging information to the console.</li>
<li><code>lib/metalsmith-setdate.js</code>: ensure each page has a date. If a <code>date</code> is not defined in the page&#39;s front-matter, it is presumed to be the publish or file creation date.</li>
<li><code>lib/metalsmith-moremeta.js</code>: applies further metadata to each page including the root folder, a default layout, primary and secondary navigation.</li>
</ul>
<nav class="nav page">
<ul>
<li><a href="../../start/page-definitions/" class="back">&laquo; back: Page definitions</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../start/installation/">Installation</a>
</li>
<li>
<a href="../../start/build/">Build</a>
</li>
<li>
<a href="../../start/site-files/">Site files</a>
</li>
<li>
<a href="../../start/page-definitions/">Page definitions</a>
</li>
<li>
<strong>Custom plugins</strong>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,119 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Site files - dashdev-website</title>
<meta name="description" content="A description of the source files used to build a website" />
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="../../css/styles.css" />
</head>
<body>
<header>
<div class="content">
<p class="logo"><a href="../../">dashdev-website</a></p>
<!-- main navigation -->
<nav class="nav main">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../start/" class="active">Start</a>
</li>
<li>
<a href="../../article/">Articles</a>
</li>
<li>
<a href="../../contact/">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="subpages">
<div class="content">
<article>
<h1>Site files</h1>
<p class="articleinfo">Published , words, -minute read</p>
<p>All files in the <code>src</code> folder can be edited:</p>
<ul>
<li>pages are created as markdown files in the <code>src/html</code> folder and sub-folders.</li>
<li>static assets such as CSS, JavaScript and image files are created in <code>src/assets</code>. These are copied without modification to <code>build/</code>.</li>
<li>page templates are defined in <code>src/template</code>.</li>
<li>reusable partials (chunks of HTML code) are declared in <code>src/partials</code>.</li>
</ul>
<nav class="nav page">
<ul>
<li><a href="../../start/build/" class="back">&laquo; back: Build</a></li></p>
<li><a href="../../start/page-definitions/" class="next">next: Page definitions &raquo;</a></li></p>
</ul>
</nav>
</article>
<!-- sub navigation -->
<nav class="nav sub">
<ul>
<li>
<a href="../../start/installation/">Installation</a>
</li>
<li>
<a href="../../start/build/">Build</a>
</li>
<li>
<strong>Site files</strong>
</li>
<li>
<a href="../../start/page-definitions/">Page definitions</a>
</li>
<li>
<a href="../../start/plugins/">Custom plugins</a>
</li>
</ul>
</nav>
</div>
</main>
<footer>
<p>By <a href="https://chat.dashdevs.org">dashdevs</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">Development build, version 1.0.0, article template</p>
</footer>
</body>
</html>

60
layouts/article.hbs Normal file
View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html>
<head>
{{> meta }}
</head>
<body>
{{> header }}
<main{{#if navsub}} class="subpages"{{/if}}>
<div class="content">
<article>
<h1>{{ title }}</h1>
{{#if isPage}}
{{else}}
<p class="articleinfo">Published {{ dateFormat }}, {{ wordCount }} words, {{ readingTime }}-minute read</p>
{{/if}}
{{{ contents }}}
{{#if isPage}}
{{> pagelist }}
{{else}}
<nav class="nav page">
<ul>
{{#if previous.title }}
<li><a href="{{ root }}{{ previous.path }}/" class="back">&laquo; back: {{ previous.title }}</a></li></p>
{{/if}}
{{#if next.title }}
<li><a href="{{ root }}{{ next.path }}/" class="next">next: {{ next.title }} &raquo;</a></li></p>
{{/if}}
</ul>
</nav>
{{/if}}
</article>
{{> navsub }}
</div>
</main>
{{> footer template='article' }}
</body>
</html>

33
layouts/page.hbs Normal file
View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
{{> meta }}
</head>
<body>
{{> header }}
<main{{#if navsub}} class="subpages"{{/if}}>
<div class="content">
<article>
{{#if title}}
<h1>{{ title }}</h1>
{{/if}}
{{{ contents }}}
</article>
{{> navsub }}
</div>
</main>
{{> footer template='page' }}
</body>
</html>

25
lib/metalsmith-debug.js Normal file
View file

@ -0,0 +1,25 @@
/*
metalsmith-debug
displays site metadata and page information in the console
*/
module.exports = function() {
'use strict';
return function(files, metalsmith, done) {
console.log('\nMETADATA:');
console.log(metalsmith.metadata());
for (var f in files) {
console.log('\nPAGE:');
console.log(files[f]);
}
done();
};
};

View file

@ -0,0 +1,94 @@
/*
metalsmith-meta
adds further meta information to metalsmith files:
root - the absolute or relative website root folder
layout - sets from default from collection
isPage - is an index page
mainCollection - the primary collection name
navmain - array of main navigation pages
navsub - array of secondary navigation pages
*/
module.exports = function() {
'use strict';
return function(files, metalsmith, done) {
var
meta = metalsmith.metadata(),
file, f, page, p, c, thisCol, layout;
for (f in files) {
file = files[f];
// calculate root
file.root = file.root || meta.rootpath || (file.path ? '../'.repeat(file.path.split('/').length) : '');
// get first non-page collection
file.mainCollection = null;
file.isPage = false;
c = 0;
while (c < file.collection.length) {
if (file.collection[c] == 'page') {
file.isPage = true;
}
else {
file.mainCollection = file.mainCollection || file.collection[c];
}
c++;
}
// main navigation
file.navmain = [];
for (p = 0; p < meta.collections.page.length; p++) {
page = meta.collections.page[p];
if (!p || page.path != meta.collections.page[p-1].path) {
file.navmain.push({
title: page.title || 'Home',
description: page.description || '',
path: file.root + page.path + (page.path ? '/' : ''),
dateFormat: page.dateFormat,
active: page.path == file.path || page.collection.indexOf(file.mainCollection) >= 0
});
}
}
if (file.mainCollection) {
// get collection metadata
thisCol = meta.collections[file.mainCollection];
// layout from page, collection, default
layout = file.layout || (thisCol.metadata && thisCol.metadata.layout) || null;
if (layout) file.layout = layout;
// secondary navigation
file.navsub = [];
for (p = 0; p < thisCol.length; p++) {
page = thisCol[p];
if (page.collection.indexOf('page') < 0 && (!p || page.path != thisCol[p-1].path)) {
file.navsub.push({
title: page.title || 'Home',
description: page.description || '',
path: file.root + page.path + (page.path ? '/' : ''),
dateFormat: page.dateFormat,
active: page.path == file.path
});
}
}
}
}
done();
};
};

39
lib/metalsmith-setdate.js Normal file
View file

@ -0,0 +1,39 @@
/*
metalsmith-setdate
ensures every file has a date set
adds dateFormat metadata with formatted creation date
*/
module.exports = function() {
'use strict';
var month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
return function(files, metalsmith, done) {
var file, f;
for (f in files) {
// get file object
file = files[f];
// date from date, publish, file creation or now
file.date =
(Date.parse(file.date) && new Date(file.date)) ||
(Date.parse(file.publish) && new Date(file.publish)) ||
(file.stats && file.stats.ctime) || new Date();
// add a formatted date
file.dateFormat =
file.date.getUTCDate() + ' ' +
month[file.date.getUTCMonth()] + ' ' +
file.date.getUTCFullYear();
}
done();
};
};

5409
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

46
package.json Normal file
View file

@ -0,0 +1,46 @@
{
"name": "dashdev-website",
"version": "1.0.0",
"description": "",
"main": "build.js",
"scripts": {
"start": "node ./build.js",
"production": "NODE_ENV=production node ./build.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dashdev-suite/dashdev-website.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/dashdev-suite/dashdev-website/issues"
},
"homepage": "https://github.com/dashdev-suite/dashdev-website#readme",
"devDependencies": {
"handlebars": "^4.7.3",
"metalsmith": "^2.3.0",
"metalsmith-assets": "^0.1.0",
"metalsmith-browser-sync": "^1.1.1",
"metalsmith-collections": "^0.9.0",
"metalsmith-feed": "^1.0.0",
"metalsmith-html-minifier": "^4.0.1",
"metalsmith-in-place": "^4.4.1",
"metalsmith-layouts": "^2.3.1",
"metalsmith-mapsite": "^1.0.6",
"metalsmith-markdown": "^1.3.0",
"metalsmith-permalinks": "^2.2.0",
"metalsmith-publish": "^0.1.5",
"metalsmith-word-count": "0.0.4"
},
"dependencies": {
"jstransformer-handlebars": "^1.1.0",
"jstransformer-markdown": "^1.2.1",
"metalsmith-discover-partials": "^0.1.2",
"metalsmith-markdown-precompiler": "^1.0.0",
"metalsmith-paths": "^3.0.1",
"metalsmith-sitemap": "^1.2.2"
}
}

277
src/assets/css/styles.css Normal file
View file

@ -0,0 +1,277 @@
/* basic page styles */
*, *:before, *:after {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
font-family: georgia, cambria, "times new roman", times, serif;
font-size: 1em;
color: #555;
background-color: #eee;
line-height: 1.5;
}
article, aside, details, figcaption, figure, footer, header, main, nav, section, summary {
display: block;
}
h1, h2, .logo {
font-family: arial, helvetica, free-sans, sans-serif;
font-weight: normal;
}
h1 {
font-size: 1.6em;
}
h2 {
font-size: 1.4em;
margin: 2rem 0 0 0;
}
p {
margin: 0 0 1em 0;
}
ul, ol {
margin: 1em 0 1.5em 3em;
}
li {
margin: 0 0 0.75em 0;
}
img {
float: right;
width: auto;
height: auto;
max-width: 50%;
margin: 0 0 1em 1em;
border: 0 none;
}
pre {
font-size: 0.8rem;
padding: 0.2em 0.4em;
margin: 1em 0 1.5em 3em;
background-color: #eff5ef;
border-radius: 3px;
overflow: auto;
}
code {
font-family: Consolas, Menlo, "DejaVu Mono", monospace;
color: #363;
background-color: #eff5ef;
border-radius: 3px;
padding: 0 0.2em;
}
pre code {
padding: 0;
}
a:link, a:visited {
text-decoration: none;
color: #66c;
}
a:hover, a:active {
color: #c66;
}
.pagelist {
list-style-type: none;
display: flex;
flex-wrap: wrap;
margin: 0;
line-height: 1.3;
}
.pagelist li {
flex: 1 1 45%;
margin: 0 1em 1em 0;
}
.pagelist a {
display: block;
height: 100%;
padding: 5px 10px;
border: 1px solid #ccc;
outline: 0 none;
overflow: hidden;
}
.pagelist a:hover, .pagelist a:focus {
background-color: #f9f9f9;
border-color: #999;
}
.pagelist h2, .pagelist p {
margin: 0;
}
.pagelist p {
color: #333;
}
p.articleinfo {
font-size: 0.8em;
color: #777;
}
/* layout */
.content {
max-width: 50em;
padding: 0 0.5em;
margin: 0 auto;
}
main {
clear: both;
background-color: #fff;
overflow: auto;
}
article {
padding: 1rem 0;
}
header, footer {
clear: both;
width: 100%;
overflow: auto;
background-color: #eee;
}
footer {
font-size: 0.85em;
padding: 1em;
text-align: center;
}
footer p {
margin: 0;
}
.logo {
font-size: 1.5em;
margin: 0.2em 0 0 0;
}
.logo a {
padding: 0.2em 0;
color: #999;
}
/* navigation */
.nav ul {
display: flex;
flex-wrap: wrap;
list-style-type: none;
margin: 0;
}
.nav li {
flex: 1 1 100%;
margin: 0;
}
.nav a, .nav strong {
display: block;
text-align: center;
white-space: nowrap;
padding: 0.6em 0;
}
.nav.main a {
color: #222;
}
.nav a.active, .nav strong {
background-color: #fff;
}
.nav.page {
margin-top: 1.5em;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
@media (min-width: 16em) {
.nav li {
flex: 1 1 50%;
}
}
@media (min-width: 32em) {
header {
position: fixed;
top: 0;
}
.logo {
float: left;
}
.nav.main {
float: right;
}
.nav li {
flex: 1 1 auto;
}
.nav.main li {
width: 6em;
}
main {
padding: 3em 0 2em 0;
}
.subpages .content {
display: flex;
}
.subpages article {
flex: 1 1 70%;
min-width: 0;
}
.subpages .nav.sub {
flex: 1 1 30%;
margin: 0 0 0 2rem;
}
.nav.sub ul {
margin-top: 1em;
flex-direction: column;
border-top: 1px dotted #ccc;
}
.nav.sub li {
border-bottom: 1px dotted #ccc;
}
.nav.sub a, .nav.sub strong {
text-align: left;
padding-left: 0.75em;
}
.nav.page a {
text-align: left;
padding-left: 0.5em;
padding-right: 0.5em;
}
.nav.page a.next {
text-align: right;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -0,0 +1,9 @@
---
title: Draft article
description: An unpublished article.
publish: draft
---
This is a draft article.
It will never appear in the site unless the `publish` front-matter is set to `published` or a date which has passed.

View file

@ -0,0 +1,7 @@
---
title: Future publication
description: This article will be published after 1 March, 2016.
publish: 2016-03-01
---
This article will only appear if the site is built is run after 1 March, 2016.

View file

@ -0,0 +1,21 @@
---
title: Gotchas
description: Issues and workarounds when using Metalsmith.
date: 2016-03-10
---
Not everything is necessarily straight-forward in the Metalsmith world&hellip;
## Incompatible plugins
Some plugins clash with another. For example, [metalsmith-rootpath](https://github.com/radiovisual/metalsmith-rootpath) which calculates relative roots does not play nicely with [metalsmith-permalinks](https://github.com/segmentio/metalsmith-permalinks) which creates custom folder structures.
*Note: `lib/metalsmith-moremeta` in this project sets a correct `root` variable whether permalinks are used or not.*
## Plugin order can be critical
One plugins may depend on another or conflict if placed the wrong way around. For example, the RSS-generating [metalsmith-feed](https://github.com/hurrymaplelad/metalsmith-feed) plugin must be called after [metalsmith-layouts](https://github.com/superwolff/metalsmith-layouts) to ensure `rss.xml` is not generated within a page template.
## Browsersync build issues
When [Browsersync](https://www.browsersync.io/) is running and files are edited, collections are re-parsed but the old data remains. This can cause menus and next/back links to be incorrect. To fix this, stop and restart the build.

38
src/html/article/gulp.md Normal file
View file

@ -0,0 +1,38 @@
---
title: Gulp
description: Do you need Gulp? Can it be integrated with Metalsmith?
publish: 2016-03-02
---
Metalsmith has plugins for [CSS pre-processing with Sass](https://github.com/stevenschobert/metalsmith-sass), [image minification](https://github.com/ahmadnassri/metalsmith-imagemin), [file concatenation](https://github.com/aymericbeaumet/metalsmith-concat), [uglification](https://github.com/ksmithut/metalsmith-uglify) and more. The build code will be familiar to anyone with [Gulp](http://gulpjs.com/) experience.
## Do you still need Gulp?
Metalsmith is often enough for simpler workflows. However, Gulp has a more extensive range of plugins and permits complex build activities such as linting and [PostCSS](http://postcss.org/) processing with [auto-prefixer](https://github.com/postcss/autoprefixer).
Metalsmith can be used within any Gulp task, e.g.
var
gulp = require('gulp'),
metalsmith = require('metalsmith'),
publish = require('metalsmith-publish'),
markdown = require('metalsmith-markdown');
// build HTML files using Metalsmith
gulp.task('html', function() {
var ms = metalsmith(dir.base)
.clean(false)
.source('src/html/')
.destination('build')
.use(publish())
.use(markdown())
.build(function(err) {
if (err) throw err;
});
});
Further Gulp tasks can then be added. Note `.clean(false)` ensures Metalsmith never wipes the build folder when other tasks are active.
There are a number of Gulp/Metalsmith integration plugins although they are rarely necessary.

View file

@ -0,0 +1,7 @@
---
title: Articles
description: A set of articles published on this site.
priority: 0.8
---
A selection of articles is available in this section.

15
src/html/article/usage.md Normal file
View file

@ -0,0 +1,15 @@
---
title: Usage options
description: What type of project could benefit from Metalsmith?
date: 2016-03-14
---
Metalsmith could be used to create any number of resources, including:
* a fast static website with minimal server-side requirements
* technical documentation
* an eBook
* application prototypes
* build tools or project scaffolding
The markdown files can be converted to other files types using plugins such as [metalsmith-pandoc](https://github.com/arve0/metalsmith-pandoc) or [metalsmith-pdf](https://github.com/jjclark1982/metalsmith-pdf).

View file

@ -0,0 +1,8 @@
---
title: Contact
priority: 0.7
---
Any questions?
Contact us at [Dash DApp Developers Discord]({{ contact }})

22
src/html/index.md Normal file
View file

@ -0,0 +1,22 @@
---
title:
description: A static HTML-only website generated using Metalsmith.io.
priority: 1.0
---
[![Node.js]({{ root }}/images/nodejs.png)](http://dash.org/)
This is a static website generated using the Node.js-powered **[Metalsmith](http://metalsmith.io)** and various published and custom plugins.
This is a demonstration rather than a recommended way to build a static site. Your requirements will be different. Please use any part of the code as you wish.
## Where could you use Metalsmith?
Metalsmith could be used to create:
* a fast static website with minimal server-side requirements
* technical documentation
* an eBook
* application prototypes
* build tools or project scaffolding
[Get started&hellip;]({{ root }}start/)

19
src/html/start/build.md Normal file
View file

@ -0,0 +1,19 @@
---
title: Build
description: How to build the static site using Metalsmith.
priority: 0.45
---
To build and launch the site in a test server using [Browsersync](https://www.browsersync.io/):
npm start
(Stop the server with `Ctrl+C`.)
To build the site for production and compress HTML files:
npm run production
The site is built in the `/build` folder.
Note you may want to change the `siteMeta.domain` and `siteMeta.rootpath` on lines 52 and 53 of `./build.js`.

6
src/html/start/index.md Normal file
View file

@ -0,0 +1,6 @@
---
title: Start
priority: 0.9
---
This section provides an overview of core code and concepts.

View file

@ -0,0 +1,16 @@
---
title: Installation
description: How to install this demonstration code.
priority: 0.5
---
Please ensure [Node.js](https://nodejs.org/) and [Git](https://git-scm.com/) are installed on your system.
Download the demonstration code and switch to directory:
git clone git@github.com:dashdev-suite/dashdev-website.git
cd metalsmith-demo
Install dependencies:
npm install

View file

@ -0,0 +1,37 @@
---
title: Page definitions
description: How pages are defined in the source folder.
priority: 0.35
---
Each sub-folder in `src/html` is a website section. Pages named `index.md` are the default page in section. File paths are translated to permalinks, e.g.
src/html/article/mypage.md
is rendered to:
build/article/mypage/index.html
Pages use YAML front-matter defined at the top. This can be referenced in templates or during the build process, e.g.
---
title: My page title
description: A description of this page for meta tags and page lists.
layout: page.html
priority: 0.9
publish: 2016-06-01
date: 2016-06-01
---
All items are optional. Note:
* `layout` defaults to `page.html` unless `metadata.layout` is defined for the page collection (see the `use(collections({ ... })` code in `build.js`).
* `priority` is a number between 0 (low) and 1 (high) which is used to order menus and define XML sitemaps.
* `publish` can be set `draft`, `private` or a future date to ensure it is not published until required.
* `date` is the date of the article. If not set, a future `publish` date or the file creation date is used.
The page content is defined in markdown, HTML syntax or both below the front-matter section. The content can include [Handlebars](http://handlebarsjs.com/) partials from the `src/partials` folder, e.g.
\{{> partialname }}
where `partialname` is the partial filename without its `.html` extension.

13
src/html/start/plugins.md Normal file
View file

@ -0,0 +1,13 @@
---
title: Custom plugins
description: The custom plugins used to create this website.
priority: 0.3
---
The `build.js` file defines how the site is built using Metalsmith and various plugins.
Several custom plugins have been created specifically for this site:
* `lib/metalsmith-debug.js`: output debugging information to the console.
* `lib/metalsmith-setdate.js`: ensure each page has a date. If a `date` is not defined in the page's front-matter, it is presumed to be the publish or file creation date.
* `lib/metalsmith-moremeta.js`: applies further metadata to each page including the root folder, a default layout, primary and secondary navigation.

View file

@ -0,0 +1,12 @@
---
title: Site files
description: A description of the source files used to build a website
priority: 0.4
---
All files in the `src` folder can be edited:
* pages are created as markdown files in the `src/html` folder and sub-folders.
* static assets such as CSS, JavaScript and image files are created in `src/assets`. These are copied without modification to `build/`.
* page templates are defined in `src/template`.
* reusable partials (chunks of HTML code) are declared in `src/partials`.

7
src/partials/footer.html Normal file
View file

@ -0,0 +1,7 @@
<footer>
<p>By <a href="{{ contact }}">{{ author }}</a> and featured on <a href="http://www.dashdevs.org/">DashDevs.org</a></p>
<p class="siteinfo">{{#if devBuild}}Development{{else}}Production{{/if}} build, version {{ version }}, {{ template }} template</p>
</footer>

10
src/partials/header.html Normal file
View file

@ -0,0 +1,10 @@
<header>
<div class="content">
<p class="logo"><a href="{{ root }}">{{ name }}</a></p>
{{> navmain }}
</div>
</header>

12
src/partials/meta.html Normal file
View file

@ -0,0 +1,12 @@
<meta charset="utf-8">
<title>{{#if title}}{{ title }} - {{/if}}{{ name }}</title>
{{#if description}}<meta name="description" content="{{ description }}" />{{/if}}
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,shrink-to-fit=no,user-scalable=no,initial-scale=1,minimum-scale=1,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="{{ root }}css/styles.css" />

10
src/partials/navmain.html Normal file
View file

@ -0,0 +1,10 @@
<!-- main navigation -->
<nav class="nav main">
<ul>
{{#each navmain}}
<li>
<a href="{{path}}"{{#if active}} class="active"{{/if}}>{{title}}</a>
</li>
{{/each}}
</ul>
</nav>

20
src/partials/navsub.html Normal file
View file

@ -0,0 +1,20 @@
{{#if navsub}}
<!-- sub navigation -->
<nav class="nav sub">
<ul>
{{#each navsub}}
<li>
{{#if active}}
<strong>{{title}}</strong>
{{else}}
<a href="{{path}}">{{title}}</a>
{{/if}}
</li>
{{/each}}
</ul>
</nav>
{{/if}}

View file

@ -0,0 +1,19 @@
{{#if navsub}}
<ul class="pagelist">
{{#each navsub}}
<li>
<a href="{{ path }}">
<h2>{{ title }}</h2>
<p class="articleinfo">{{ dateFormat }}</p>
{{#if description}}
<p>{{ description }}</p>
{{/if}}
</a>
</li>
{{/each}}
</ul>
{{/if}}