summaryrefslogtreecommitdiffstats
path: root/lib/backbone
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-15 09:55:12 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-15 09:55:12 +0100
commit1b19c6660303cb6ce98ac0ad76580f66b52985f1 (patch)
tree2e7df114dfe057e644667b1c719fb03b1eddfa20 /lib/backbone
parentd7077fc7db130d91f117dbf7ef01ec6ff5c6fb8e (diff)
downloadgitbook-1b19c6660303cb6ce98ac0ad76580f66b52985f1.zip
gitbook-1b19c6660303cb6ce98ac0ad76580f66b52985f1.tar.gz
gitbook-1b19c6660303cb6ce98ac0ad76580f66b52985f1.tar.bz2
Complete page.previous and page.next variables
Diffstat (limited to 'lib/backbone')
-rw-r--r--lib/backbone/summary.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/backbone/summary.js b/lib/backbone/summary.js
index f4b9288..cef3ae9 100644
--- a/lib/backbone/summary.js
+++ b/lib/backbone/summary.js
@@ -41,6 +41,14 @@ TOCArticle.prototype.walk = function(iter) {
});
};
+// Return templating context for an article
+TOCArticle.prototype.getContext = function() {
+ return {
+ title: this.title,
+ path: this.path
+ };
+};
+
// Return true if is pointing to a file
TOCArticle.prototype.hasLocation = function() {
return Boolean(this.path);