Files: 86cfe7c6ec39c87ba43e41c3ed13c7902bf07fd8 / tmpl / page.part.js
848 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 hero = '' |
10 | if (opts.hero) { |
11 | hero = opts.hero |
12 | } else { |
13 | hero = `<div class="hero small"> |
14 | <h1><a href="/"><img src="/img/hermies-256.png"></a> Scuttlebot</h1> |
15 | </div>` |
16 | } |
17 | |
18 | // pick the navs |
19 | var tabFn = tabs[opts.section || 'docs'] |
20 | var leftnavFn = leftnav[opts.tab || 'basics'] |
21 | |
22 | // render the page |
23 | return `<html> |
24 | ${head()} |
25 | <body> |
26 | ${hero} |
27 | ${tabs.sections(opts.section)} |
28 | ${tabFn(opts.tab)} |
29 | <div class="nav-content-unit"> |
30 | ${leftnavFn(opts.path)} |
31 | <div class="content"> |
32 | ${opts.content} |
33 | </div> |
34 | </div> |
35 | ${footer(opts.path)} |
36 | </body> |
37 | </html>` |
38 | } |
Built with git-ssb-web