Skip to content

Commit

Permalink
Adds a GitHub link on the API page's sidebar
Browse files Browse the repository at this point in the history
Fixes #137
  • Loading branch information
leobalter committed Mar 14, 2016
1 parent 936ea19 commit 3209738
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/tmpl/docs.jade
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ block content
ul.nav.nav-list
each link in sidebar
if link.url
if locals.rootSidebar
li
a(href='/' + link.url, class=locals.pageSegment == link.url && 'active')= link.name
- var linkHref
if link.external
- linkHref = link.url
else if locals.rootSidebar
- linkHref = '/' + link.url
else
li
a(href='/' + page + '/' + link.url, class=locals.pageSegment == link.url && 'active')= link.name
- linkHref = '/' + page + '/' + link.url
li
a(href=linkHref, class=locals.pageSegment == link.url && 'active')= link.name
else
li.nav-header
if link.icon
i(class=link.icon)
span= link.name
include blocks/advertisements
include blocks/advertisements
6 changes: 6 additions & 0 deletions tasks/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ module.exports = function (grunt) {
sidebars[0] = getSidebarSection('## API', 'icon-cog');
sidebars[1] = getSidebarSection('### Other');

sidebars[1].push({
name: 'GitHub',
url: 'https://github.com/gruntjs/',
external: true
});

names.forEach(function (name) {
var src = base + name + '.md',
dest = 'build/api/' + name.toLowerCase() + '.html';
Expand Down

0 comments on commit 3209738

Please sign in to comment.