Upgrade to nick_site commit f981fa57, adds alerts and inactive sidebar option
[ndcode_site.git] / projects / index.html.jst
1 return async env => {
2   let breadcrumbs = await _require('/_lib/breadcrumbs.jst')
3   let get_navigation = await _require('/_lib/get_navigation.jst')
4   let navbar = await _require('/_lib/navbar.jst')
5
6   await navbar(
7     env,
8     // head
9     async _out => {},
10     // body
11     async _out => {
12       await breadcrumbs(env, _out)
13
14       p {
15         'The below projects are essentially frameworks that make it easier for you to build something. To make use of them, you will need to be familiar with either '
16         tt {'Python'}
17         ' or '
18         tt {'node.js'}
19         ' depending on each project’s language. The frameworks meet my needs for the present, and are intended to become more mature over time based on your feedback and/or contributions.'
20       }
21
22       p {
23         'Go on, take a look inside! '
24         i {'[Actually don\'t because it\'s still under construction]'}
25       }
26
27       let transaction = await env.site.database.Transaction()
28       try {
29         let root = await transaction.get()
30         let p = await get_navigation(root, env.component_names)
31         let children = await p.get('children')
32         let menu = await p.get_json('menu')
33
34         nav {
35           for (let i = 0; i < menu.length; ++i) {
36             let name = menu[i]
37             let q = await children.get(name)
38
39             // note: make the row a link to show hover background at edges
40             // (similar to the grid-gutter-background class I use elsewhere)
41             // note: position: relative sets the target for stretched link
42             div.row.flex-nowrap.align-items-center.nav-link-outer.position-relative {
43               div.col.col-icon128 {
44                 div.img-fluid.py-3 {
45                   _out.push(
46                     await env.site.get_min_svg(await q.get_json('icon'))
47                   )
48                 }
49               }
50               div.col.col-text {
51                 a.nav-link-inner.stretched-link(href=`${name}/index.html`) {
52                   span.h2{
53                     `${await q.get_json('title')}`
54                   }
55                   br {}
56                   span.h4{
57                     `${await q.get_json('description')}`
58                   }
59  
60                 }
61               }
62             }
63           }
64         }
65       }
66       finally {
67         transaction.rollback()
68       }
69     },
70     // scripts
71     async _out => {}
72   )
73 }