summaryrefslogtreecommitdiffstats
path: root/lib/page
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-14 19:27:58 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-14 19:27:58 +0100
commitcfefa7d57992738373649dab16cbaf4754c3e5c7 (patch)
treeee315f0c8ea499b026bb4c8596c8a6520c67ffb5 /lib/page
parentdef115fe0f1df5c7c28694e99e096877a5c02e50 (diff)
downloadgitbook-cfefa7d57992738373649dab16cbaf4754c3e5c7.zip
gitbook-cfefa7d57992738373649dab16cbaf4754c3e5c7.tar.gz
gitbook-cfefa7d57992738373649dab16cbaf4754c3e5c7.tar.bz2
Add .next and .prev to TOCArticle
Diffstat (limited to 'lib/page')
-rw-r--r--lib/page/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/page/index.js b/lib/page/index.js
index d057441..6911ce2 100644
--- a/lib/page/index.js
+++ b/lib/page/index.js
@@ -106,13 +106,17 @@ Page.prototype.read = function() {
// Return templating context for this page
// This is used both for themes and page parsing
Page.prototype.getContext = function() {
+ var article = this.book.summary.find(this);
+
return {
file: {
path: this.path,
mtime: this.mtime
},
page: {
- // todo
+ title: article? article.title : null,
+ next: article? article.next() : null,
+ previous: article? article.prev() : null
}
};
};