select a template using yaml
This commit is contained in:
5
app.py
5
app.py
@ -102,7 +102,10 @@ env.filters["prettydate"] = prettydate
|
||||
# translate a single file into HTML
|
||||
def render_single_file(page, path, dist, name = False):
|
||||
name = Path(path).stem
|
||||
template = env.select_template([f"{name}.jinja", "index.jinja"])
|
||||
template_name = name
|
||||
if "template" in page:
|
||||
template_name = page["template"]
|
||||
template = env.select_template([f"{template_name}.jinja", "index.jinja"])
|
||||
html = template.render(documents=documents, page=page, name=name)
|
||||
|
||||
if not os.path.exists(dist):
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: A newsletter for december
|
||||
published: false
|
||||
template: newsletter
|
||||
---
|
||||
|
||||
# Klankbord Digest January 2025
|
||||
|
@ -1,3 +1,9 @@
|
||||
---
|
||||
title: A title for my fun newsletter
|
||||
published: false
|
||||
template: newsletter
|
||||
---
|
||||
|
||||
I'd like to begin this month's Klankbord Digest with a server update.
|
||||
Let's backtrack a bit to understand how the current circumstances
|
||||
arose. The server began as a prototype on a Mac Pro Trash Bin computer
|
||||
|
@ -23,6 +23,7 @@
|
||||
max-width: 800px;
|
||||
margin: 2rem auto;
|
||||
font-family: sans-serif;
|
||||
padding: 12px;
|
||||
}
|
||||
</style>
|
||||
{% block title %}
|
||||
@ -38,7 +39,7 @@
|
||||
</head>
|
||||
</head>
|
||||
<body>
|
||||
settings for newssletter only {{ name }}
|
||||
|
||||
<main>
|
||||
<section>
|
||||
<article>
|
Reference in New Issue
Block a user