git ssb

2+

cel / scuttlebot.io



Tree: a738ecf91d844ee886e94857a82177ab446113f1

Files: a738ecf91d844ee886e94857a82177ab446113f1 / tmpl / page.part.js

848 bytesRaw
1var head = require('./head.part')
2var tabs = require('./tabs.part')
3var leftnav = require('./leftnav.part')
4var footer = require('./footer.part')
5
6module.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