From fa00b52fb510340630a37ea1c5bc4bfead6613d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Wed, 30 Apr 2014 16:46:24 +0200 Subject: [PATCH] Fix #127: add configuration for changing links in sidebar --- README.md | 9 +++++++- lib/generate/index.js | 27 +++++++++++++--------- lib/generate/site/index.js | 4 +++- theme/templates/includes/book/summary.html | 25 ++++++++++++++++---- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a9f2a00c6..8cd88e433 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,14 @@ Here are the options that can be stored in this file: "plugins": [], // Global configuration for plugins - "pluginsConfig": {} + "pluginsConfig": {}, + + // Links in template (null: default, false: remove, string: new value) + "links": { + "about": null, + "issues": null, + "edit": null + } } ``` diff --git a/lib/generate/index.js b/lib/generate/index.js index 898e71f28..c6c26ca11 100644 --- a/lib/generate/index.js +++ b/lib/generate/index.js @@ -28,29 +28,34 @@ var generate = function(options) { options = _.defaults(options || {}, { // Folders to use - input: null, - output: null, + "input": null, + "output": null, // Config file (relative to input) - configFile: "book.json", + "configFile": "book.json", // Output generator - generator: "site", + "generator": "site", // Book title, keyword, description - title: null, - description: null, + "title": null, + "description": null, // Origin github repository id - github: null, - githubHost: 'https://github.com/', + "github": null, + "githubHost": 'https://github.com/', // Theming - theme: path.resolve(__dirname, '../../theme'), + "theme": path.resolve(__dirname, '../../theme'), // Plugins - plugins: [], - pluginsConfig: {} + "plugins": [], + "pluginsConfig": {}, + + // Links + "links": { + "about": null + } }); if (!options.input) { diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js index 51f66f0a1..b63f70398 100644 --- a/lib/generate/site/index.js +++ b/lib/generate/site/index.js @@ -80,7 +80,9 @@ Generator.prototype._writeTemplate = function(tpl, options, output, interpolate) allNavigation: that.options.navigation, plugins: that.plugins, - pluginsConfig: JSON.stringify(that.options.pluginsConfig) + pluginsConfig: JSON.stringify(that.options.pluginsConfig), + + options: that.options }, options)); }) .then(interpolate) diff --git a/theme/templates/includes/book/summary.html b/theme/templates/includes/book/summary.html index 638ec1514..1066da4fb 100644 --- a/theme/templates/includes/book/summary.html +++ b/theme/templates/includes/book/summary.html @@ -3,18 +3,28 @@