site.py
Python script, ASCII text executable
1import vial 2import markdown 3 4my_site = vial.Site("my_site") 5 6 7@my_site.filter("markdown") 8def markdown_filter(text): 9return markdown.markdown2html(text) 10 11 12# Create a new page with the default template and the index.md document 13my_first_page = vial.Page(my_site, "default.html", vial.Document("index.md")) 14 15# Add the page to the site 16my_site.add_page("/", my_first_page) 17 18# Add static files 19my_site.add_from_index(vial.Index("static"), "/static", None, static=True) 20 21my_site.build() 22