diff options
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/navigation.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/parse/navigation.js b/lib/parse/navigation.js index 52f3028..3140a1a 100644 --- a/lib/parse/navigation.js +++ b/lib/parse/navigation.js @@ -23,10 +23,16 @@ function navigation(summary, files) { // Mapping of prev/next for a give path var mapping = {}; + // Special README nav + var README_NAV = { + path: 'README.html', + title: 'Introdunction', + }; + // Walk the chapter/article tree and create navigation entires _.each(summary.chapters, function(chapter, idx, chapters) { var currentChapter = clean(chapter); - var prevChapter = (idx-1 < 0) ? null : chapters[idx-1]; + var prevChapter = (idx-1 < 0) ? README_NAV : chapters[idx-1]; var nextChapter = (idx+1 >= chapters.length) ? null : chapters[idx+1]; var prev = (!prevChapter || _.isEmpty(prevChapter.articles)) ? |