summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornasirkhan <nasir8891@gmail.com>2015-02-27 22:16:11 +0600
committernasirkhan <nasir8891@gmail.com>2015-02-27 22:16:11 +0600
commiteac513cfa370e1303dcd6ff3842d4f15b9eaf5f4 (patch)
tree1cdf5d823dc5bd0498cc48a359084949abb6acfb
parent62c99759c1f3998720179f4230a2210ef6c8f836 (diff)
parent5ec8a1f18c881a3bc17924ba103241f387eb0289 (diff)
downloadgitbook-eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4.zip
gitbook-eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4.tar.gz
gitbook-eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4.tar.bz2
Merge remote-tracking branch 'upstream/version/2.0' into version/2.0
-rw-r--r--CHANGES.md14
-rw-r--r--lib/book.js2
-rw-r--r--lib/utils/page.js6
-rw-r--r--package.json6
-rw-r--r--theme/i18n/en.json20
-rw-r--r--theme/templates/ebook/layout.html2
-rw-r--r--theme/templates/website/includes/summary.html4
-rw-r--r--theme/templates/website/layout.html2
8 files changed, 46 insertions, 10 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 59743aa..fe474b5 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,4 +1,18 @@
# 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.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
diff --git a/lib/book.js b/lib/book.js
index 6cdc3e6..3912977 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));
diff --git a/lib/utils/page.js b/lib/utils/page.js
index fce800b..cdc7d1a 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);
diff --git a/package.json b/package.json
index 23d8e4d..071c1f2 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",
@@ -13,8 +13,8 @@
"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-autoescape": "0.1.0",
+ "nunjucks": "git+https://github.com/mozilla/nunjucks.git#42d2b9f5c0ad5db8ca3a1fdbba5bde9fc4cc2c45",
+ "nunjucks-autoescape": "0.1.1",
"nunjucks-filter": "0.1.0",
"nunjucks-i18n": "1.0.0",
"semver": "2.2.1",
diff --git a/theme/i18n/en.json b/theme/i18n/en.json
new file mode 100644
index 0000000..37a7bf3
--- /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"
+}
diff --git a/theme/templates/ebook/layout.html b/theme/templates/ebook/layout.html
index 2849404..1a9c01c 100644
--- a/theme/templates/ebook/layout.html
+++ b/theme/templates/ebook/layout.html
@@ -9,7 +9,7 @@
<meta name="description" content="{% block description %}{% endblock %}">
<meta name="generator" content="GitBook {{ gitbook.version }}">
{% block head %}{% endblock %}
- {{ htmlSnippet("head:end")|default("") }}
+ {{ htmlSnippet("head:end")|default("")|safe }}
</head>
<body>
{{ htmlSnippet("body:start")|default("")|safe }}
diff --git a/theme/templates/website/includes/summary.html b/theme/templates/website/includes/summary.html
index 5f09e13..6aa523b 100644
--- a/theme/templates/website/includes/summary.html
+++ b/theme/templates/website/includes/summary.html
@@ -38,10 +38,10 @@
<ul class="summary">
{% set _divider = false %}
{% if options.links.sidebar %}
- {% for link in options.links.sidebar %}
+ {% for linkTitle, link in options.links.sidebar %}
{% set _divider = true %}
<li>
- <a href="{{ options.links.sidebar[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a>
+ <a href="{{ link }}" target="blank" class="custom-link">{{ linkTitle }}</a>
</li>
{% endfor %}
{% endif %}
diff --git a/theme/templates/website/layout.html b/theme/templates/website/layout.html
index fca3313..e412c0c 100644
--- a/theme/templates/website/layout.html
+++ b/theme/templates/website/layout.html
@@ -2,7 +2,7 @@
<html lang="{{ language }}">
{{ htmlSnippet("html:start")|default("")|safe }}
<head>
- {{ htmlSnippet("head:start")|default("") }}
+ {{ htmlSnippet("head:start")|default("")|safe }}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
<title>{% block title %}{% endblock %}</title>