|
|
|
|
|
|
|
|
import markdown |
|
|
import markdown |
|
|
from jinja2 import Environment as Env |
|
|
from jinja2 import Environment as Env |
|
|
from jinja2 import FileSystemLoader |
|
|
from jinja2 import FileSystemLoader |
|
|
|
|
|
|
|
|
from minicli import cli, run, wrap |
|
|
from minicli import cli, run, wrap |
|
|
|
|
|
|
|
|
# Useful for dates rendering within Jinja2. |
|
|
# Useful for dates rendering within Jinja2. |
|
|
|
|
|
|
|
|
print(f"Done: http://larlet.test:8001/{post_base}/") |
|
|
print(f"Done: http://larlet.test:8001/{post_base}/") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli |
|
|
|
|
|
def home(): |
|
|
|
|
|
"""Build the home page with last published items.""" |
|
|
|
|
|
template = environment.get_template("profil.html") |
|
|
|
|
|
content = template.render(note_list=Note.all(source=DAVID / "stream" / "2019"),) |
|
|
|
|
|
open(DAVID / "index.html", "w").write(content) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli |
|
|
@cli |
|
|
def feed(): |
|
|
def feed(): |
|
|
"""Generate a feed from last published items in stream.""" |
|
|
|
|
|
|
|
|
"""Generate a feed from last published items.""" |
|
|
template = environment.get_template("feed.xml") |
|
|
template = environment.get_template("feed.xml") |
|
|
content = template.render( |
|
|
content = template.render( |
|
|
note_list=Note.all(source=DAVID / "stream" / "2019")[:15], |
|
|
note_list=Note.all(source=DAVID / "stream" / "2019")[:15], |