Skip to content

Commit 9449d5b

Browse files
committed
add multi hbs template and 'view all on one page' links + page
1 parent bc81c4e commit 9449d5b

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

index.js

+7
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ app.get("/content.lite.json", cors(), function(req, res) {
5454
res.json(lite)
5555
})
5656

57+
app.get("/all", function(req, res) {
58+
res.render("multi", {
59+
content: content,
60+
heading: "All Docs"
61+
})
62+
})
63+
5764
app.get("/*", function(req, res) {
5865
var page = find(content.pages, function(page) {
5966
return page.href === req.path

public/styles/index.styl

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ header
3434

3535
#page
3636
margin-top 30px
37+
.pageHeading
38+
text-decoration underline
3739

3840
h1
3941
font-size 48px
@@ -94,6 +96,9 @@ nav
9496
margin-bottom 100px
9597
width navWidth
9698

99+
.smallLink
100+
font-size 13px
101+
97102
section.active
98103
h2
99104
a

views/layout.hbs

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
</section>
4545
{{/each}}
46+
<a class="smallLink" href="/all">view all on one page</a>
4647
</nav>
47-
4848
{{{body}}}
4949

5050
<div class="toc">
@@ -72,6 +72,11 @@
7272

7373
</section>
7474
{{/each}}
75+
<section id="viewAll">
76+
<h2 title="View All">
77+
<a href="/all">View All On One Page</a>
78+
</h2>
79+
</section>
7580
</div>
7681

7782
<footer>

views/multi.hbs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<div class="container">
2+
<div id="page">
3+
{{#if heading}}
4+
<h1 class="pageHeading">{{heading}}</h1>
5+
{{/if}}
6+
7+
{{#each content.pages}}
8+
{{#if heading}}
9+
<h1>{{heading}}</h1>
10+
{{/if}}
11+
{{{ content }}}
12+
13+
<p class="colophon">
14+
{{#if modifiedPretty}}
15+
Last modified {{modifiedPretty}}
16+
{{/if}}
17+
&nbsp;
18+
&nbsp;
19+
&nbsp;
20+
&nbsp;
21+
&nbsp;
22+
{{#if edit_url}}
23+
Found a typo? Send a
24+
<a href="{{edit_url}}">pull request!</a>
25+
{{/if}}
26+
27+
</p>
28+
{{/each}}
29+
</div>
30+
</div>

0 commit comments

Comments
 (0)