mirror of
https://github.com/Mibew/docs.mibew.org.git
synced 2024-11-15 00:24:13 +03:00
Initial commit
This commit is contained in:
commit
f79432ab82
4
.bowerrc
Normal file
4
.bowerrc
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"analytics": false,
|
||||
"directory": "assets/third-party"
|
||||
}
|
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Do not index node.js modules that are used for building
|
||||
node_modules
|
||||
|
||||
# Do not index bower components
|
||||
assets/third-party
|
||||
|
||||
# Do not index built docs
|
||||
build
|
BIN
assets/favicon.ico
Normal file
BIN
assets/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 894 B |
11
assets/theme.css
Normal file
11
assets/theme.css
Normal file
@ -0,0 +1,11 @@
|
||||
body {
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.nav-left-indent .nav {
|
||||
margin-left: 15px;
|
||||
}
|
8
bower.json
Normal file
8
bower.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "docs.mibew.org",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"bootstrap": "~3.3.4",
|
||||
"jquery": "~1.11.2"
|
||||
}
|
||||
}
|
61
index.js
Normal file
61
index.js
Normal file
@ -0,0 +1,61 @@
|
||||
var Metalsmith = require('metalsmith'),
|
||||
markdown = require('metalsmith-markdown'),
|
||||
permalinks = require('metalsmith-permalinks'),
|
||||
assets = require('metalsmith-assets'),
|
||||
templates = require('metalsmith-templates'),
|
||||
navigation = require('metalsmith-navigation'),
|
||||
bower = require('bower');
|
||||
|
||||
// Install bower dependencies
|
||||
bower.commands.install([], {}, {})
|
||||
.on('error', function(error) {
|
||||
throw error;
|
||||
})
|
||||
.on('end', function() {
|
||||
// Build the site
|
||||
(new Metalsmith(__dirname))
|
||||
// This data will be available inside the templates
|
||||
.metadata({
|
||||
baseUrl: '',
|
||||
githubUrl: 'https://github.com/mibew/mibew',
|
||||
// It's documented nowhere but these partials will be passed to
|
||||
// Handlebars.js template engine.
|
||||
partials: {
|
||||
// File extension is not skipped here because it will be
|
||||
// append automatically using one from rendered file.
|
||||
menu: 'menu'
|
||||
}
|
||||
})
|
||||
.use(markdown())
|
||||
// Permalink pattern is intentionally omitted to convert files like
|
||||
// path/to/md/file.md to path/to/md/file/index.html
|
||||
.use(permalinks())
|
||||
.use(navigation(
|
||||
{
|
||||
contents: {
|
||||
sortBy: 'nav_sort',
|
||||
filterProperty: 'show_in_menu',
|
||||
includeDirs: true
|
||||
}
|
||||
},
|
||||
navSettings = {
|
||||
navListProperty: 'navs',
|
||||
permalinks: true
|
||||
}
|
||||
))
|
||||
.use(templates({
|
||||
engine: 'handlebars',
|
||||
// The extension cannot be omitted here because it will be used
|
||||
// for all partials later.
|
||||
'default': 'default.handlebars'
|
||||
}))
|
||||
.use(assets({
|
||||
source: './assets',
|
||||
destination: './assets'
|
||||
}))
|
||||
.build(function(err) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
});
|
12
package.json
Normal file
12
package.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"metalsmith-templates": "^0.7.0",
|
||||
"metalsmith-markdown": "^0.2.1",
|
||||
"metalsmith-permalinks": "^0.4.0",
|
||||
"metalsmith-navigation": "https://github.com/unstoppablecarl/metalsmith-navigation/archive/82a23b98a659097355ef784ecebbee1a56c36aac.tar.gz",
|
||||
"metalsmith-assets": "^0.1.0",
|
||||
"metalsmith": "^1.5.0",
|
||||
"handlebars": "^3.0.1",
|
||||
"bower": "^1.4.1"
|
||||
}
|
||||
}
|
7
src/index.md
Normal file
7
src/index.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Documentation home
|
||||
---
|
||||
|
||||
# This is the home of Mibew documentation
|
||||
|
||||
This just a test page that does not bring any new info to people.
|
68
templates/default.handlebars
Normal file
68
templates/default.handlebars
Normal file
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" href="{{baseUrl}}/assets/favicon.ico">
|
||||
|
||||
<title>{{title}} — Mibew docs</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{baseUrl}}/assets/third-party/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="{{baseUrl}}/assets/theme.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="{{baseUrl}}">Mibew</a>
|
||||
</div>
|
||||
<div id="navbar">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="{{githubUrl}}">GitHub</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="well">
|
||||
<h4>Contents</h4>
|
||||
<nav>{{> menu navs.contents}}</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<article>
|
||||
{{{contents}}}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.container -->
|
||||
|
||||
|
||||
<!-- Bootstrap core JavaScript -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="{{baseUrl}}/assets/third-party/jquery/dist/jquery.min.js"></script>
|
||||
<script src="{{baseUrl}}/assets/third-party/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
11
templates/menu.handlebars
Normal file
11
templates/menu.handlebars
Normal file
@ -0,0 +1,11 @@
|
||||
{{#if this}}
|
||||
<ul class="nav nav-stacked nav-left-indent">
|
||||
{{#each this}}
|
||||
<li>
|
||||
<a href="{{@root.baseUrl}}/{{path}}">{{name}}</a>
|
||||
{{! Render nested menu levels}}
|
||||
{{> menu children}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
Loading…
Reference in New Issue
Block a user