html templates: Add 'public' attr and indicate public/private mode
This commit is contained in:
parent
f2bd2196b0
commit
aefcbb61b2
|
|
@ -8,6 +8,7 @@
|
|||
<link href="/css/style.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<p>${page.all?'private mode':'public mode'}</p>
|
||||
${page.indexPage ? '' : '<a href="/">↖index</a>'}
|
||||
${page._body}
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
(pages) => base_html.ori({
|
||||
(pages, all) => base_html.ori({
|
||||
indexPage: true
|
||||
all: all
|
||||
title: 'Hans Fast'
|
||||
_body: Tree.indent`
|
||||
<h1>Hans Fast</h1>
|
||||
|
|
|
|||
3
page.ori
3
page.ori
|
|
@ -1,5 +1,6 @@
|
|||
(page) => base_html.ori({
|
||||
(page, all) => base_html.ori({
|
||||
indexPage: false
|
||||
all
|
||||
title: page.title
|
||||
_body: Tree.indent`
|
||||
<h1>${page.title}</h1>
|
||||
|
|
|
|||
4
site.ori
4
site.ori
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
}.final
|
||||
|
||||
renderedPages: Tree.map(pages, page.ori)
|
||||
renderedPages: Tree.map(pages, (page) => <page.ori>(page, all))
|
||||
|
||||
/*
|
||||
assets are relative to the pubfiles directory
|
||||
|
|
@ -60,6 +60,6 @@
|
|||
/*
|
||||
Now, I think I have enough to build both the individual pages and the index page!
|
||||
*/
|
||||
index.html: indexPage.ori(pages)
|
||||
index.html: indexPage.ori(pages, all)
|
||||
...renderedPages/
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue