summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/gitbook.js4
-rw-r--r--lib/generate/index.js8
-rw-r--r--templates/layout.html4
3 files changed, 11 insertions, 5 deletions
diff --git a/bin/gitbook.js b/bin/gitbook.js
index fc9bfc3..c21b955 100755
--- a/bin/gitbook.js
+++ b/bin/gitbook.js
@@ -26,11 +26,12 @@ prog
.description('Build a gitbook from a directory')
.option('-o, --output <directory>', 'Path to output directory, defaults to ./_book')
.option('-t, --title <name>', 'Name of the book to generate, defaults to repo name')
+.option('-i, --intro <intro>', 'Description of the book to generate')
.option('-g, --github <repo_path>', 'ID of github repo like : username/repo')
.action(buildFunc = function(dir, options) {
dir = dir || process.cwd();
outputDir = options.output || path.join(dir, '_book');
-
+
console.log('Starting build ...');
// Get repo's URL
return utils.gitURL(dir)
@@ -47,6 +48,7 @@ prog
outputDir,
{
title: options.title || utils.titleCase(repo),
+ description: options.intro,
github: options.github || repoID
}
);
diff --git a/lib/generate/index.js b/lib/generate/index.js
index 07b62d0..43f9497 100644
--- a/lib/generate/index.js
+++ b/lib/generate/index.js
@@ -11,8 +11,9 @@ var generate = function(root, output, options) {
var files, summary, navigation, tpl;
options = _.defaults(options || {}, {
- // Book title
+ // Book title, keyword, description
title: null,
+ description: "Book generated using GitBook",
// Origin github repository id
github: null
@@ -59,9 +60,12 @@ var generate = function(root, output, options) {
root: root,
output: output,
locals: {
+ title: options.title,
+ description: options.description,
+
githubAuthor: options.github.split("/")[0],
githubId: options.github,
- title: options.title,
+
summary: summary,
allNavigation: navigation
}
diff --git a/templates/layout.html b/templates/layout.html
index 366c561..6eee18f 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -8,8 +8,8 @@
<link rel="icon" href="{{ staticBase }}/images/icons/32.png">
<link rel="stylesheet" href="{{ staticBase }}/style.css">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
- <meta name="description" content="{% block description %}{% endblock %}">
- <meta name="keywords" content="{% block keywords %}{% endblock %}" >
+ <meta name="description" content="{{ description }}">
+ <meta name="keywords" content="gitbook,github" >
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">