Skip to content

Commit

Permalink
Make the site generation a bit more general
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed May 3, 2015
1 parent e724873 commit ef47c10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion site/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ metalSmith(__dirname)
files[file].windowTitle = files[file].title;
}

files[file].url = '/' + file.replace(/\.md$/, '/');
files[file].url = '/' + file.replace(/(\/?)index.md$/, '$1').replace(/\.md$/, '/');
});
next();
})
Expand Down
6 changes: 5 additions & 1 deletion site/templates/_header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
<li class="menu-toggle-item">
<button class="menu-toggle" onclick="toggleSidebar()"></button>
</li>
<li class="<%- path === '' ? 'active' : '' %>"><a href="<%= '/' %>">Unexpected</a></li>
<% collections.pages.forEach(function (page) { %>
<li class="<%- '/' + path === page.url ? 'active' : '' %>"><a href="<%= page.url %>"><%= page.title %></a></li>
<% }) %>
<li class="<%- path.match(/^assertions\/?/) ? 'active' : '' %>"><a href="<%= assertionsByType.any[0].url %>">Assertions</a></li>
<% if (collections.apiPages.length > 0) { %>
<li class="<%- path.match(/^api\/?/) ? 'active' : '' %>"><a href="<%= collections.apiPages[0].url %>">API</a></li>
<% } %>
</ul>
</nav>
<div class="search" style="visibility: hidden">
Expand Down

0 comments on commit ef47c10

Please sign in to comment.