Skip to content

Commit

Permalink
Added 'keep it simple' default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Johnson committed Oct 8, 2009
1 parent 05822e9 commit f8e1cf1
Show file tree
Hide file tree
Showing 25 changed files with 1,164 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
*.pyc *.pyc
.*
3 changes: 3 additions & 0 deletions admin.py
Expand Up @@ -89,6 +89,9 @@ def decorate(self, post_id=None):


class BaseHandler(webapp.RequestHandler): class BaseHandler(webapp.RequestHandler):
def render_to_response(self, template_name, template_vals=None, theme=None): def render_to_response(self, template_name, template_vals=None, theme=None):
template_vals.update({
'config': config,
})
template_name = os.path.join("admin", template_name) template_name = os.path.join("admin", template_name)
self.response.out.write(render_template(template_name, template_vals, self.response.out.write(render_template(template_name, template_vals,
theme)) theme))
Expand Down
19 changes: 19 additions & 0 deletions config.py
@@ -1,6 +1,12 @@
# Name of the blog # Name of the blog
blog_name = 'My Blog' blog_name = 'My Blog'


# Your name (used for copyright info)
author_name = 'the author'

# (Optional) slogan
slogan = 'This is my blog'

# Selects the theme to use. Theme names correspond to directories under # Selects the theme to use. Theme names correspond to directories under
# the 'themes' directory, containing templates and static content. # the 'themes' directory, containing templates and static content.
theme = 'default' theme = 'default'
Expand All @@ -11,3 +17,16 @@
# month - the month the post was published in # month - the month the post was published in
# day - the day the post was published in # day - the day the post was published in
post_path_format = '/%(year)d/%(month)02d/%(slug)s' post_path_format = '/%(year)d/%(month)02d/%(slug)s'

# A nested list of sidebar menus, for convenience. If this isn't versatile
# enough, you can edit themes/default/base.html instead.
sidebars = [
('Blogroll', [
('Nick Johnson', 'http://blog.notdot.net/'),
('Bill Katz', 'http://www.billkatz.com/'),
('Coding Horror', 'http://www.codinghorror.com/blog/'),
('Craphound', 'http://craphound.com/'),
('Neopythonic', 'http://www.neopythonic.blogspot.com/'),
('Schneier on Security', 'http://www.schneier.com/blog/'),
]),
]
3 changes: 2 additions & 1 deletion themes/default/admin/edit.html
@@ -1,6 +1,7 @@
{% extends "../base.html" %} {% extends "../base.html" %}
{% block title %}New Post{% endblock %} {% block title %}{% if form.instance %}Edit{% else %}New{% endif %} Post{% endblock %}
{% block body %} {% block body %}
<h2>{% if form.instance %}Edit{% else %}New{% endif %} Post</h2>
<form method="post" action=""> <form method="post" action="">
<table> <table>
{{form}} {{form}}
Expand Down
1 change: 1 addition & 0 deletions themes/default/admin/index.html
@@ -1,6 +1,7 @@
{% extends "../base.html" %} {% extends "../base.html" %}
{% block title %}All Posts{% endblock %} {% block title %}All Posts{% endblock %}
{% block body %} {% block body %}
<h2>All Posts</h2>
<p>Posts {{offset}} to {{last_post}}</p> <p>Posts {{offset}} to {{last_post}}</p>
<table> <table>
<thead> <thead>
Expand Down
45 changes: 43 additions & 2 deletions themes/default/base.html
@@ -1,9 +1,50 @@
<html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title>{% block title %}Bloggart{% endblock %}</title> <title>{% block title %}Bloggart{% endblock %}</title>
<link rel="stylesheet" type="text/css" media="screen" href="/static/default/css/screen.css" />
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body> <body>
{% block body %}{% endblock %} <div id="header-wrap"><div id="header" class="container_16">
<h1 id="logo-text"><a href="index.html" title="">{{config.blog_name}}</a></h1>
<p id="intro">{{config.slogan}}</p>
<div id="nav">
<ul>
<li id="current"><a href="/">Home</a></li>
</ul>
</div>
<div id="header-image"></div>
</div></div>
<div id="content-outer"><div id="content-wrapper" class="container_16">
<div id="main" class="grid_12">
{% block body %}{% endblock %}
</div>
<div id="left-columns" class="grid_4">
{% for sidebar in config.sidebars %}
<div class="sidemenu">
<h3>{{sidebar.0}}</h3>
<ul>
{% for entry in sidebar.1 %}
<li><a href="{{entry.1}}">{{entry.0}}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div></div>
<div id="footer-wrapper" class="container_16">
<div id="footer-bottom">
<p class="bottom-left">
&nbsp; &copy; {{config.author_name}} &nbsp; &nbsp;
Design by : <a href="http://www.styleshout.com/">styleshout</a>
</p>
<p class="bottom-right" >
<a href="/">Home</a> |
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> |
<a href="http://validator.w3.org/check/referer">XHTML</a>
</p>
</div>
</div>
</body> </body>
</html> </html>
1 change: 1 addition & 0 deletions themes/default/post.html
@@ -1,5 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}{{post.title}} - {{config.blog_name}}{% endblock %} {% block title %}{{post.title}} - {{config.blog_name}}{% endblock %}
{% block body %} {% block body %}
<h2>{{post.title}}</h2>
{{post.body}} {{post.body}}
{% endblock %} {% endblock %}

0 comments on commit f8e1cf1

Please sign in to comment.