From c777023e9f9880390da0e14c6269d77e6992c75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 17 Feb 2015 14:18:49 +0100 Subject: [PATCH 1/9] Add introduction to changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 59743aa14..342742b8d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,6 @@ # Release notes +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). ## 2.0.0-alpha.7 - Fix display of glossary in ebook formats From f531a3f98479b79e48af4ffa3bc2000e1766533f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 20 Feb 2015 12:24:23 +0100 Subject: [PATCH 2/9] Update nunjucks-autoescape --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23d8e4d37..1b56bf0a0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "fstream-ignore": "1.0.2", "gitbook-parsers": "0.4.1", "nunjucks": "git+https://github.com/SamyPesse/nunjucks.git#4019d1b7379372336b86ce1b0bf84352a2029747", - "nunjucks-autoescape": "0.1.0", + "nunjucks-autoescape": "0.1.1", "nunjucks-filter": "0.1.0", "nunjucks-i18n": "1.0.0", "semver": "2.2.1", From 23fcb817a4ce6cd3595ac038abc0668def0ec4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 20 Feb 2015 20:52:07 +0100 Subject: [PATCH 3/9] Fix html snippets escaping --- theme/templates/ebook/layout.html | 2 +- theme/templates/website/layout.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/templates/ebook/layout.html b/theme/templates/ebook/layout.html index 2849404d4..1a9c01cc2 100644 --- a/theme/templates/ebook/layout.html +++ b/theme/templates/ebook/layout.html @@ -9,7 +9,7 @@ {% block head %}{% endblock %} - {{ htmlSnippet("head:end")|default("") }} + {{ htmlSnippet("head:end")|default("")|safe }} {{ htmlSnippet("body:start")|default("")|safe }} diff --git a/theme/templates/website/layout.html b/theme/templates/website/layout.html index fca3313bd..e412c0c14 100644 --- a/theme/templates/website/layout.html +++ b/theme/templates/website/layout.html @@ -2,7 +2,7 @@ {{ htmlSnippet("html:start")|default("")|safe }} - {{ htmlSnippet("head:start")|default("") }} + {{ htmlSnippet("head:start")|default("")|safe }} {% block title %}{% endblock %} From 01b160f9a1b816315a2fe78c31d32c5c5b1b359c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Sat, 21 Feb 2015 13:40:35 +0100 Subject: [PATCH 4/9] Fix normalization of html link (README to index) --- lib/book.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/book.js b/lib/book.js index 6cdc3e65f..39129779c 100644 --- a/lib/book.js +++ b/lib/book.js @@ -664,7 +664,7 @@ Book.prototype.resolve = function(p) { // Normalize a link to .html and convert README -> index Book.prototype.contentLink = function(link) { if ( - path.basename(link) == "README" + path.basename(link, path.extname(link)) == "README" || link == this.readmeFile ) { link = path.join(path.dirname(link), "index"+path.extname(link)); From d9ddbff44308dd5bcf06556e7c3496d59ad44294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 24 Feb 2015 13:51:10 +0100 Subject: [PATCH 5/9] Fix links in sidebar --- theme/templates/website/includes/summary.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/templates/website/includes/summary.html b/theme/templates/website/includes/summary.html index 5f09e131d..6aa523be9 100644 --- a/theme/templates/website/includes/summary.html +++ b/theme/templates/website/includes/summary.html @@ -38,10 +38,10 @@
    {% set _divider = false %} {% if options.links.sidebar %} - {% for link in options.links.sidebar %} + {% for linkTitle, link in options.links.sidebar %} {% set _divider = true %}
  • - {{ loop.key }} + {{ linkTitle }}
  • {% endfor %} {% endif %} From 52078eb6668ebf1d9ad7f6c7d909b764e38b7664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 24 Feb 2015 13:54:08 +0100 Subject: [PATCH 6/9] Use latest nunjucks from mozilla/nunjucks --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b56bf0a0..cf0b1a277 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "fs-extra": "0.16.3", "fstream-ignore": "1.0.2", "gitbook-parsers": "0.4.1", - "nunjucks": "git+https://github.com/SamyPesse/nunjucks.git#4019d1b7379372336b86ce1b0bf84352a2029747", + "nunjucks": "git+https://github.com/mozilla/nunjucks.git#42d2b9f5c0ad5db8ca3a1fdbba5bde9fc4cc2c45", "nunjucks-autoescape": "0.1.1", "nunjucks-filter": "0.1.0", "nunjucks-i18n": "1.0.0", From 366e6ed105816e0bec64ea9eadc1e6089ee3c15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 24 Feb 2015 13:57:20 +0100 Subject: [PATCH 7/9] Bump version to 2.0.0-alpha.9 --- CHANGES.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 342742b8d..fe474b529 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 2.0.0-alpha.9 +- Fix links in sidebar +- Fix normalization of html link (README to index) +- Fix html snippets escaping + +## 2.0.0-alpha.8 +- Improve locale detection for i18n +- Fix chapter name for Glossary in pdf +- Don't escape html in glossary items +- Fix generation of multilingual book as ebook +- Add "post" block attribute to post-process + ## 2.0.0-alpha.7 - Fix display of glossary in ebook formats - Add default footer and header to pdf diff --git a/package.json b/package.json index cf0b1a277..071c1f278 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gitbook", - "version": "2.0.0-alpha.8", + "version": "2.0.0-alpha.9", "homepage": "https://www.gitbook.com", "description": "Library and cmd utility to generate GitBooks", "main": "lib/index.js", From c923a7e01a7eb3f12587f75ff07e94a6adbec08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 26 Feb 2015 01:14:27 +0100 Subject: [PATCH 8/9] Fix transformation of README.md links in index.html --- lib/utils/page.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils/page.js b/lib/utils/page.js index fce800b93..cdc7d1ad5 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -189,8 +189,10 @@ function normalizeHtml(src, options) { if (links.isRelative(href)) { var absolutePath = path.join(options.base, href); - // If is in navigation relative: change extsnio nto be .html - if (options.navigation[absolutePath]) href = links.changeExtension(href, ".html"); + // If is in navigation relative: transform as content + if (options.navigation[absolutePath]) { + href = options.book.contentLink(href); + } // Transform as absolute href = links.toAbsolute(href, options.base, options.output); From 5ec8a1f18c881a3bc17924ba103241f387eb0289 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Fri, 27 Feb 2015 16:02:31 +0100 Subject: [PATCH 9/9] Add en.json Fixes #620 --- theme/i18n/en.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 theme/i18n/en.json diff --git a/theme/i18n/en.json b/theme/i18n/en.json new file mode 100644 index 000000000..37a7bf355 --- /dev/null +++ b/theme/i18n/en.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Choose a language", + "GLOSSARY": "Glossary", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Glossary", + "GITBOOK_LINK": "Published with GitBook", + "SUMMARY": "Table of Contents", + "SUMMARY_INTRODUCTION": "Introduction", + "SUMMARY_TOGGLE": "Table of Contents", + "SEARCH_TOGGLE": "Search", + "SEARCH_PLACEHOLDER": "Type to search", + "FONTSETTINGS_TOGGLE": "Font Settings", + "SHARE_TOGGLE": "Share", + "SHARE_ON": "Share on __platform__", + "FONTSETTINGS_WHITE": "White", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Night", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +}