diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-12-03 23:19:47 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-12-03 23:19:47 +0100 |
commit | c9a31cc9878259e5a800f530adf81f9dd2744ee8 (patch) | |
tree | 9a70801ab5e1f15b20f7a5736179dc181dd14855 | |
parent | f03c316274ca6b0bcf80eaf861af676921b47063 (diff) | |
download | gitbook-c9a31cc9878259e5a800f530adf81f9dd2744ee8.zip gitbook-c9a31cc9878259e5a800f530adf81f9dd2744ee8.tar.gz gitbook-c9a31cc9878259e5a800f530adf81f9dd2744ee8.tar.bz2 |
Add option isbn for books
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | lib/generate/config.js | 3 | ||||
-rw-r--r-- | lib/generate/ebook/index.js | 1 | ||||
-rwxr-xr-x | theme/templates/layout.html | 3 |
4 files changed, 8 insertions, 2 deletions
@@ -52,9 +52,10 @@ Here are the options that can be stored in this file: // It's not advised this option in the book.json "generator": "site", - // Book title and description (defaults are extracted from the README) + // Book metadats (somes are extracted from the README by default) "title": null, "description": null, + "isbn": null, // For ebook format, the extension to use for generation (default is detected from output extension) // "epub", "pdf", "mobi" diff --git a/lib/generate/config.js b/lib/generate/config.js index d2054df..fb232a6 100644 --- a/lib/generate/config.js +++ b/lib/generate/config.js @@ -17,9 +17,10 @@ var CONFIG = { // Configuration file to use "configFile": "book", - // Book title and description (defaults are extracted from the README) + // Book metadats (somes are extracted from the README by default) "title": null, "description": null, + "isbn": null, // For ebook format, the extension to use for generation (default is detected from output extension) // "epub", "pdf", "mobi" diff --git a/lib/generate/ebook/index.js b/lib/generate/ebook/index.js index bc39e15..4ecccec 100644 --- a/lib/generate/ebook/index.js +++ b/lib/generate/ebook/index.js @@ -30,6 +30,7 @@ Generator.prototype.finish = function() { "--cover": that.options.cover, "--title": that.options.title, "--comments": that.options.description, + "--isbn": that.options.isbn, "--authors": that.options.author, "--publisher": "GitBook", "--chapter": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]", diff --git a/theme/templates/layout.html b/theme/templates/layout.html index ead0380..5dc7c5e 100755 --- a/theme/templates/layout.html +++ b/theme/templates/layout.html @@ -15,6 +15,9 @@ <meta name="apple-mobile-web-app-status-bar-style" content="black"> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ staticBase }}/images/apple-touch-icon-precomposed-152.png"> <link rel="shortcut icon" href="{{ staticBase }}/images/favicon.ico" type="image/x-icon"> + {% if options.isbn %} + <meta name="identifier" content="{{ options.isbn }}" scheme="ISBN"> + {% endif %} {% block head %}{% endblock %} {{ htmlSnippet("head:end")|default("") }} </head> |