# HG changeset patch # User Steve Losh # Date 1232776276 18000 # Node ID 09b70d37fb659d05fdd479740e4122b1cafcec4b # Parent 4ee184bf2f39b072d0f68ea7388abf383fe18d61 Added the Typogrify template tag and started using it everywhere! diff -r 4ee184bf2f39 -r 09b70d37fb65 blog/views.py --- a/blog/views.py Fri Jan 23 23:56:12 2009 -0500 +++ b/blog/views.py Sat Jan 24 00:51:16 2009 -0500 @@ -49,7 +49,7 @@ akismet_data['user_agent'] = request.META['HTTP_USER_AGENT'] akismet_data['comment_author'] = fields['name'] akismet_data['comment_type'] ='comment' - spam = ak.comment_check(fields['body'], akismet_data) + spam = ak.comment_check(fields['body'].encode('ascii', 'ignore'), akismet_data) new_comment = Comment(name=fields['name'], body=fields['body'], diff -r 4ee184bf2f39 -r 09b70d37fb65 projects/views.py --- a/projects/views.py Fri Jan 23 23:56:12 2009 -0500 +++ b/projects/views.py Sat Jan 24 00:51:16 2009 -0500 @@ -37,7 +37,7 @@ akismet_data['user_agent'] = request.META['HTTP_USER_AGENT'] akismet_data['comment_author'] = fields['name'] akismet_data['comment_type'] ='comment' - spam = ak.comment_check(fields['body'], akismet_data) + spam = ak.comment_check(fields['body'].encode('ascii', 'ignore'), akismet_data) new_comment = Comment(name=fields['name'], body=fields['body'], diff -r 4ee184bf2f39 -r 09b70d37fb65 settings.py --- a/settings.py Fri Jan 23 23:56:12 2009 -0500 +++ b/settings.py Sat Jan 24 00:51:16 2009 -0500 @@ -91,4 +91,5 @@ 'stevelosh.projects', 'stevelosh.thoughts', 'mobileadmin', + 'typogrify', ) diff -r 4ee184bf2f39 -r 09b70d37fb65 site-media/style/stevelosh.css --- a/site-media/style/stevelosh.css Fri Jan 23 23:56:12 2009 -0500 +++ b/site-media/style/stevelosh.css Sat Jan 24 00:51:16 2009 -0500 @@ -106,3 +106,17 @@ .invalid { color: #F00; } + +/* Typogrify Styles */ + +.amp { + color: #444; + font-size: 1.05em; + font-family: "Warnock Pro", "Palatino", "Book Antiqua", serif; + font-style: italic; +} + +a:hover .amp { color: inherit; } +.caps { font-size: 0.92em; } +.quo { margin-left: -0.30em; } +.dquo { margin-left: -0.38em; } diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/blog/entry.html --- a/templates/blog/entry.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/blog/entry.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,87 +1,88 @@ {% extends "blog/base.html" %} {% load markup %} +{% load typogrify %} {% block title %}{{ entry.title }}{% endblock %} {% block script %} - - + + {% endblock %} {% block content %} -
-

- - {{ entry.title }} - -

-
-

- Posted - on {{ entry.pub_date.date|date:"F j, Y" }} - at {{ entry.pub_date.time|time:"g:i A" }} -

-
-
- {{ entry.body|markdown:"codehilite" }} -
-
-
- {% ifnotequal comments.count 0 %} -
-

Comments

- {% for comment in comments %} -
- -

{{ comment.name }} said:

-
- {{ comment.body|markdown:"safe" }} -
-
- {% endfor %} -
-
- {% endifnotequal %} -
-

Add your comment:

-
-

- What's your name? -

-

- - -

-

- -

-

- You can use Markdown. -

-

You're going to say:

-
-

- -

-
-
- - - - + output: "Markdown", + buttons: "bold italic | link blockquote code | ol ul heading hr" + }; + + + {% endblock %} \ No newline at end of file diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/blog/list.html --- a/templates/blog/list.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/blog/list.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,4 +1,5 @@ {% extends "blog/base.html" %} +{% load typogrify %} {% block content %}
@@ -6,10 +7,10 @@

- {{ entry.title }} + {{ entry.title|typogrify }}

-

{{ entry.snip }}

+

{{ entry.snip|typogrify }}

{% endfor %} diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/flatpages/default.html --- a/templates/flatpages/default.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/flatpages/default.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load markup %} +{% load typogrify %} {% block title %}{{ flatpage.title }}{% endblock %} @@ -7,6 +8,6 @@ {% block content %}
- {{ flatpage.content|markdown }} + {{ flatpage.content|markdown|typogrify }}
{% endblock %} \ No newline at end of file diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/flatpages/splash.html --- a/templates/flatpages/splash.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/flatpages/splash.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,4 +1,5 @@ {% extends "flatpages/default.html" %} +{% load typogrify %} {% block style %}

I like writing. »

@@ -23,4 +25,5 @@

Stay up to date. »

+{% endfilter %} {% endblock %} \ No newline at end of file diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/projects/list.html --- a/templates/projects/list.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/projects/list.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,4 +1,5 @@ {% extends "projects/base.html" %} +{% load typogrify %} {% block content %}
@@ -6,10 +7,10 @@

- {{ project.name }} + {{ project.name|typogrify }}

-

{{ project.snip }}

+

{{ project.snip|typogrify }}

{% endfor %}
diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/projects/project.html --- a/templates/projects/project.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/projects/project.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,90 +1,91 @@ {% extends "projects/base.html" %} {% load markup %} +{% load typogrify %} {% block title %}{{ project.name }}{% endblock %} {% block script %} - - - + + + {% endblock %} {% block content %} -
-

- - {{ project.name }} - -

-
-

- Posted - on {{ project.posted.date|date:"F j, Y" }} - at {{ project.posted.time|time:"g:i A" }} -

-
-
- {{ project.body|markdown:"codehilite" }} -
-
-
- {% ifnotequal comments.count 0 %} -
-

Comments

- {% for comment in comments %} -
- -

{{ comment.name }} said:

-
- {{ comment.body|markdown:"safe" }} -
-
- {% endfor %} -
-
- {% endifnotequal %} -
-

Add your comment:

-
-

- What's your name? -

-

- - -

-

- -

-

- You can use Markdown. -

-

You're going to say:

-
-

- -

-
-
- - - - + output: "Markdown", + buttons: "bold italic | link blockquote code | ol ul heading hr" + }; + + + {% endblock %} \ No newline at end of file diff -r 4ee184bf2f39 -r 09b70d37fb65 templates/thoughts/list.html --- a/templates/thoughts/list.html Fri Jan 23 23:56:12 2009 -0500 +++ b/templates/thoughts/list.html Sat Jan 24 00:51:16 2009 -0500 @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load markup %} +{% load typogrify %} {% block title %}Thoughts{% endblock %} @@ -21,9 +22,9 @@
{% ifnotequal thought.title None %} -

{{ thought.title }}

+

{{ thought.title|typogrify }}

{% endifnotequal %} - {{ thought.body|markdown:"safe" }} + {{ thought.body|markdown|typogrify }}
{% endifequal %} {% ifequal thought.type 'link' %} @@ -34,13 +35,13 @@ {% endifequal %}