html templates: Add 'public' attr and indicate public/private mode

This commit is contained in:
Hans Fast 2026-03-09 14:15:56 +01:00
parent f2bd2196b0
commit aefcbb61b2
4 changed files with 7 additions and 4 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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/
}