diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-06-16 00:25:59 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-06-16 00:25:59 -0700 |
commit | a258feea37c7a872a1437f48c1b90d161f8227c7 (patch) | |
tree | 153a052d4b2a107a65987b757c679eb3c1c12947 /lib/parse | |
parent | 3a3332d0b9a69ca3d5472b6e5ad0c4da539f0af5 (diff) | |
download | gitbook-a258feea37c7a872a1437f48c1b90d161f8227c7.zip gitbook-a258feea37c7a872a1437f48c1b90d161f8227c7.tar.gz gitbook-a258feea37c7a872a1437f48c1b90d161f8227c7.tar.bz2 |
Remove special case in navigation
For intro node
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/navigation.js | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/parse/navigation.js b/lib/parse/navigation.js index f216d03..ae4eb9d 100644 --- a/lib/parse/navigation.js +++ b/lib/parse/navigation.js @@ -12,27 +12,6 @@ function flattenChapters(chapters) { }, []); } -function defaultChapters(flatChapters) { - // Special README nav - var README_NAV = { - path: 'README.md', - title: 'Introduction', - level: '0', - }; - - // First chapter - var first = _.first(flatChapters); - - // Check for intro node - if(first && first.path === 'README.md') { - // If present, return unmodified - return flatChapters; - } - - // Otherwise add in default node - return [README_NAV].concat(flatChapters); -} - // Returns from a summary a map of /* { @@ -49,7 +28,7 @@ function navigation(summary, files) { // List of all navNodes // Flatten chapters, then add in default README node if ndeeded etc ... - var navNodes = defaultChapters(flattenChapters(summary.chapters)); + var navNodes = flattenChapters(summary.chapters); var prevNodes = [null].concat(navNodes.slice(0, -1)); var nextNodes = navNodes.slice(1).concat([null]); |