Files: 9e4b77aeb7181a93a9ee3ceb1c21d11841a35f57 / tmpl / page.part.js
954 bytesRaw
1 | var head = require('./head.part') |
2 | var tabs = require('./tabs.part') |
3 | var leftnav = require('./leftnav.part') |
4 | var footer = require('./footer.part') |
5 | |
6 | module.exports = (opts) => { |
7 | |
8 | // render the hero |
9 | var title = '' |
10 | if (opts.bigHero) { |
11 | title = `<div class="hero big"> |
12 | <img src="/img/hermies-256.png"> |
13 | <h1>Scuttlebot<br><small>peer-to-peer mesh database</small></h1> |
14 | </div>` |
15 | } else { |
16 | title = `<div class="hero small"> |
17 | <h1><a href="/"><img src="/img/hermies-256.png"></a> Scuttlebot<br><small>peer-to-peer mesh database</small></h1> |
18 | </div>` |
19 | } |
20 | |
21 | // pick the nav |
22 | var leftnavFn = leftnav[opts.tab || 'basics'] |
23 | |
24 | // render the page |
25 | return `<html> |
26 | ${head()} |
27 | <body> |
28 | ${title} |
29 | ${tabs(opts.tab)} |
30 | <div class="nav-content-unit"> |
31 | ${leftnavFn(opts.path)} |
32 | <div class="content"> |
33 | ${opts.content} |
34 | </div> |
35 | </div> |
36 | ${footer(opts.path)} |
37 | </body> |
38 | </html>` |
39 | } |
Built with git-ssb-web