Skip to content

Commit

Permalink
support review post
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Jul 4, 2012
1 parent f8160d1 commit 8c76966
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
20 changes: 20 additions & 0 deletions README.md
Expand Up @@ -125,3 +125,23 @@ If you want to allow people to comment on your secret post, set
```python
allow_comment_on_secret_post = True
```

## Write a Review

This theme supports [review microdata](http://support.google.com/webmasters/bin/answer.py?hl=en&answer=146645#Individual_reviews).

Write your post:

```
# title
- date: 2012-12-12
- review: movie or book title
- rating: 4
------------
content
```

Rating is optional, the max rating is 5.
2 changes: 1 addition & 1 deletion static/style.css
Expand Up @@ -267,7 +267,7 @@ hr.end {
.entry-title, .hentry h2, .hentry h3, .hentry h4 {
color: #222;
}
.entry-meta, .entry-meta a, .updated, .updated a {
.entry-meta, .entry-meta a, .updated, .updated a , .entry-review {
color: #999;
font-size: 14px;
}
Expand Down
16 changes: 12 additions & 4 deletions templates/post.html
Expand Up @@ -6,10 +6,10 @@
{% endblock %}

{% block main -%}
<div class="hentry">
<div class="hentry"{%if post.review%} itemscope itemtype="http://schema.org/Review"{%endif%}>
<h1 class="entry-title">{{post.title}}</h1>
<div class="entry-meta">
<time class="updated" datetime="{{post.date|xmldatetime}}">
<time class="updated" datetime="{{post.date|xmldatetime}}"{%if post.review%} itemprop="dtreviewed"{%endif%}>
<a href="{{ post|year_url }}">{{post.date.strftime('%Y-%m-%d')}}</a>
</time>
{% if theme.show_author -%}
Expand All @@ -18,11 +18,18 @@ <h1 class="entry-title">{{post.title}}</h1>
{% else -%}
by {{post.author.name}}
{%- endif %}
{%- endif %}
{%- endif -%}
</div>
<div class="entry-content">
<div class="entry-content"{%if post.review%} itemprop="description"{%endif%}>
{{post.content}}
</div>

{% if post.review %}
<div class="entry-review">
<span itemprop="itemreviewed">{{post.review}}</span> Reviewed by <span itemprop="reviewer">{{post.author.name}}</span> {%if post.rating%} Rating <span itemprop="rating">{{post.rating}}</span>{%endif%}
</div>
{% endif %}

<div class="entry-tags">
{% for tag in post.tags -%}
{%- if theme.tagcloud -%}
Expand All @@ -32,6 +39,7 @@ <h1 class="entry-title">{{post.title}}</h1>
{%- endif %}
{%- endfor %}
</div>

{% if theme.disqus -%}
{%- if theme.allow_comment_on_secret_post or post.public %}
<div id="disqus_thread"></div>
Expand Down

0 comments on commit 8c76966

Please sign in to comment.