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">
|
<link href="/css/style.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<p>${page.all?'private mode':'public mode'}</p>
|
||||||
${page.indexPage ? '' : '<a href="/">↖index</a>'}
|
${page.indexPage ? '' : '<a href="/">↖index</a>'}
|
||||||
${page._body}
|
${page._body}
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
(pages) => base_html.ori({
|
(pages, all) => base_html.ori({
|
||||||
indexPage: true
|
indexPage: true
|
||||||
|
all: all
|
||||||
title: 'Hans Fast'
|
title: 'Hans Fast'
|
||||||
_body: Tree.indent`
|
_body: Tree.indent`
|
||||||
<h1>Hans Fast</h1>
|
<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
|
indexPage: false
|
||||||
|
all
|
||||||
title: page.title
|
title: page.title
|
||||||
_body: Tree.indent`
|
_body: Tree.indent`
|
||||||
<h1>${page.title}</h1>
|
<h1>${page.title}</h1>
|
||||||
|
|
|
||||||
4
site.ori
4
site.ori
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
}.final
|
}.final
|
||||||
|
|
||||||
renderedPages: Tree.map(pages, page.ori)
|
renderedPages: Tree.map(pages, (page) => <page.ori>(page, all))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
assets are relative to the pubfiles directory
|
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!
|
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/
|
...renderedPages/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue