By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 site.py

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