Sfoglia il codice sorgente

Add home generation

master
David Larlet 5 anni fa
parent
commit
38eb57f869
Non sono state trovate chiavi note per questa firma nel database
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10
    1
      site.py

+ 10
- 1
site.py Vedi File

@@ -15,6 +15,7 @@ from time import perf_counter
import markdown
from jinja2 import Environment as Env
from jinja2 import FileSystemLoader

from minicli import cli, run, wrap

# Useful for dates rendering within Jinja2.
@@ -234,9 +235,17 @@ def blog():
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
def feed():
"""Generate a feed from last published items in stream."""
"""Generate a feed from last published items."""
template = environment.get_template("feed.xml")
content = template.render(
note_list=Note.all(source=DAVID / "stream" / "2019")[:15],

Loading…
Annulla
Salva