mirror of
https://github.com/seigler/dashdev-website
synced 2025-07-26 22:36:09 +00:00
add layout hbs files for docs, boxes, tutorials and blog
add pagelist-docs partial
This commit is contained in:
parent
6d07d54042
commit
e8385b274b
8 changed files with 280 additions and 8 deletions
20
build.js
20
build.js
|
@ -101,17 +101,17 @@ var metalsmith = Metalsmith(__dirname)
|
||||||
reverse: true,
|
reverse: true,
|
||||||
refer: true,
|
refer: true,
|
||||||
metadata: {
|
metadata: {
|
||||||
layout: './../src/layouts/article.hbs' // default is <root>/layouts
|
layout: './../src/layouts/docs.hbs' // default is <root>/layouts
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
article: {
|
blog: {
|
||||||
pattern: 'article/**/*',
|
pattern: 'blog/**/*',
|
||||||
sortBy: 'date',
|
sortBy: 'date',
|
||||||
reverse: true,
|
reverse: true,
|
||||||
refer: true,
|
refer: true,
|
||||||
limit: 50,
|
limit: 50,
|
||||||
metadata: {
|
metadata: {
|
||||||
layout: './../src/layouts/article.hbs'
|
layout: './../src/layouts/blog.hbs'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tutorials: {
|
tutorials: {
|
||||||
|
@ -120,6 +120,9 @@ var metalsmith = Metalsmith(__dirname)
|
||||||
reverse: true,
|
reverse: true,
|
||||||
refer: true,
|
refer: true,
|
||||||
limit: 50,
|
limit: 50,
|
||||||
|
metadata: {
|
||||||
|
layout: './../src/layouts/tutorials.hbs'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
boxes: {
|
boxes: {
|
||||||
pattern: 'boxes/**/*',
|
pattern: 'boxes/**/*',
|
||||||
|
@ -127,13 +130,16 @@ var metalsmith = Metalsmith(__dirname)
|
||||||
reverse: true,
|
reverse: true,
|
||||||
refer: true,
|
refer: true,
|
||||||
limit: 50,
|
limit: 50,
|
||||||
|
metadata: {
|
||||||
|
layout: './../src/layouts/boxes.hbs'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.use(markdownPrecompiler({ // convert {{> navmain}} in header.html
|
.use(markdownPrecompiler({ // convert {{> navmain}} in header.html
|
||||||
engine: "handlebars",
|
engine: "handlebars",
|
||||||
pattern: /\.md$/, // regex; no idea why .md works, check discoverPartials above
|
pattern: /\.md$/, // regex; no idea why .md works, check discoverPartials above
|
||||||
partialsPath: './../partials',
|
partialsPath: './../partials',
|
||||||
partials: ['navmain', 'navsub', 'footer', 'header', 'meta', 'pagelist']
|
partials: ['navmain', 'navsub', 'footer', 'header', 'meta', 'pagelist', 'pagelist-docs']
|
||||||
}))
|
}))
|
||||||
.use(markdown()) // convert markdown
|
.use(markdown()) // convert markdown
|
||||||
.use(permalinks({ // generate permalinks
|
.use(permalinks({ // generate permalinks
|
||||||
|
@ -173,8 +179,8 @@ metalsmith
|
||||||
hostname: siteMeta.domain + (siteMeta.rootpath || ''),
|
hostname: siteMeta.domain + (siteMeta.rootpath || ''),
|
||||||
omitIndex: true // replace any paths ending in index.html with ''. Useful when you're using metalsmith-permalinks.
|
omitIndex: true // replace any paths ending in index.html with ''. Useful when you're using metalsmith-permalinks.
|
||||||
}))
|
}))
|
||||||
.use(rssfeed({ // generate RSS feed for articles
|
.use(rssfeed({ // generate RSS feed for articles (update: now blog)
|
||||||
collection: 'article',
|
collection: 'blog',
|
||||||
site_url: siteMeta.domain + (siteMeta.rootpath || ''),
|
site_url: siteMeta.domain + (siteMeta.rootpath || ''),
|
||||||
title: siteMeta.name,
|
title: siteMeta.name,
|
||||||
description: siteMeta.desc
|
description: siteMeta.desc
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: blockman
|
title: blockman
|
||||||
|
description: WIP from the cloud on wheels
|
||||||
priority: 0.7
|
priority: 0.7
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: dashbox
|
title: dashbox
|
||||||
|
description: Simple development framework for Dash Platform
|
||||||
priority: 0.8
|
priority: 0.8
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
65
src/layouts/blog.hbs
Normal file
65
src/layouts/blog.hbs
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
{{> meta }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
{{> header }}
|
||||||
|
|
||||||
|
<main{{#if navsub}} class="subpages" {{/if}}>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
{{> navsub }}
|
||||||
|
|
||||||
|
<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">« back: {{ previous.title }}</a></li>
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if next.title }}
|
||||||
|
<li><a href="{{ root }}{{ next.path }}/" class="next">next: {{ next.title }} »</a></li>
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
{{> footer template='article' }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
51
src/layouts/boxes.hbs
Normal file
51
src/layouts/boxes.hbs
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
{{> meta }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
{{> header }}
|
||||||
|
|
||||||
|
{{!-- <main{{#if navsub}} class="subpages" {{/if}}> --}}
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
{{!-- {{> navsub }} --}}
|
||||||
|
|
||||||
|
<article>
|
||||||
|
|
||||||
|
<h1>{{ title }}</h1>
|
||||||
|
|
||||||
|
{{#if isPage}}
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
<p class="articleinfo">Published {{ dateFormat }}, {{ wordCount }} words, {{ readingTime }}-minute read</p>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{{ contents }}}
|
||||||
|
|
||||||
|
{{#if isPage}}
|
||||||
|
|
||||||
|
{{> pagelist }}
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
{{> footer template='article' }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
65
src/layouts/docs.hbs
Normal file
65
src/layouts/docs.hbs
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
{{> meta }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
{{> header }}
|
||||||
|
|
||||||
|
<main{{#if navsub}} class="subpages" {{/if}}>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
{{> navsub }}
|
||||||
|
|
||||||
|
<article>
|
||||||
|
|
||||||
|
<h1>{{ title }}</h1>
|
||||||
|
|
||||||
|
{{#if isPage}}
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
<p></p>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{{ contents }}}
|
||||||
|
|
||||||
|
{{#if isPage}}
|
||||||
|
|
||||||
|
{{> pagelist-docs }}
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
<nav class="nav page">
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
{{#if previous.title }}
|
||||||
|
<li><a href="{{ root }}{{ previous.path }}/" class="back">« back: {{ previous.title }}</a></li>
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if next.title }}
|
||||||
|
<li><a href="{{ root }}{{ next.path }}/" class="next">next: {{ next.title }} »</a></li>
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
{{> footer template='article' }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
65
src/layouts/tutorials.hbs
Normal file
65
src/layouts/tutorials.hbs
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
{{> meta }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
{{> header }}
|
||||||
|
|
||||||
|
<main{{#if navsub}} class="subpages" {{/if}}>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
{{> navsub }}
|
||||||
|
|
||||||
|
<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">« back: {{ previous.title }}</a></li>
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if next.title }}
|
||||||
|
<li><a href="{{ root }}{{ next.path }}/" class="next">next: {{ next.title }} »</a></li>
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
{{> footer template='article' }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
18
src/partials/pagelist-docs.html
Normal file
18
src/partials/pagelist-docs.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{{#if navsub}}
|
||||||
|
<ul class="pagelist">
|
||||||
|
|
||||||
|
{{#each navsub}}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path }}">
|
||||||
|
|
||||||
|
<h2>{{ title }}</h2>
|
||||||
|
|
||||||
|
{{#if description}}
|
||||||
|
<p>{{ description }}</p>
|
||||||
|
{{/if}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
{{/if}}
|
Loading…
Add table
Add a link
Reference in a new issue