Skip to content

Instantly share code, notes, and snippets.

@amcgregor
Created December 4, 2010 18:36
Show Gist options
  • Save amcgregor/728379 to your computer and use it in GitHub Desktop.
Save amcgregor/728379 to your computer and use it in GitHub Desktop.
Master / theme template, included by inner page templates.
# encoding: utf-8
from __future__ import unicode_literals
from alacarte.template.simplithe.html5 import *
__all__ = ['theme']
theme = [
match ( "title" ) [
title [ matched, " — Craphound.ca" ]
],
match ( "header" ) [
header [
link ( rel = "stylesheet", src = "/theme/css/styles.css" ),
matched
],
flush
]
match ( "body" ) [
body [
header [
h1 [ "My Awesome Site" ],
aside [
form ( action = "/search" ) [
input ( type = "search", name = "q", placeholder = "Site-wide search" )
]
]
],
matched,
footer [
p ( class_ = "copyright" ) [ "Copyright © 2010 Alice Bevan-McGregor" ]
]
]
]
]
# encoding: utf-8
from __future__ import unicode_literals
from alacarte.template.simplithe.html5 import *
from master import theme
__all__ = ['welcome']
welcome = html [
theme,
head [
title [ "Welcome" ]
],
body [
article [
h1 [ "Latest News" ],
dl [[[
dt [ a ( href = "" ) [ article.title ] ],
dd [ article.description ]
] for article in news.objects()[:10] ] ]
]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment