1
0
mirror of https://github.com/arsenetar/pelican-red.git synced 2024-11-22 11:19:02 +00:00

Update templates to include microformat support

The templates now include microformatting from schema.org.
The title and content_title blocks are no longer in most templates.
This updates the progess on issue #1
This commit is contained in:
Andrew Senetar 2013-07-30 14:58:58 -04:00
parent 9f22128702
commit 0d53dc55d4
11 changed files with 50 additions and 40 deletions

View File

@ -2,13 +2,14 @@
{% if name in AUTHORS %}
{% set props = AUTHORS[name] %}
{% endif %}
<li class="row">
<li class="row" itemprop="itemListElement" itemscope itemtype="http://schema.org/Person">
<meta itemprop="memberOf" content="{{ SITENAME }}" />
<div class="author">
<div class="small-4 columns">
<a class="th" href="{{ SITEURL }}/{{ author.url }}">
{% if props %}
{% for key, value in props.vcard if key == 'photo' %}
<img src="{{ value }}" />
<img src="{{ value }}" itemprop="image" />
{% else %}
<img src="{{ SITEURL+'/'+FAVICON }}"/>
{% endfor %}
@ -23,22 +24,32 @@ <h3><a href="{{ SITEURL+'/'+author.url }}">{{ author }}</a></h3>
</header>
<ul class="vcard">
{% if props %}
{% for key, value in props.vcard if not key == 'photo' %}
{% for key, value in props.vcard %}
<li class="{{key}}">
{% if key == 'email' %}
<a href="mailto:{{ value }}">{{ value }}</a>
{% if key == 'fn' %}
<span itemprop="name">{{ value }}</span>
{% elif key == 'email' %}
<a href="mailto:{{ value }}"itemprop="email">{{ value }}</a>
{% elif key == 'url' %}
<a href="{{ value }}">{{ value }}</a>
{% elif key == 'notes' %}
<p>{{ value }}</p>
<a href="{{ value }}" itemprop="sameAs">{{ value }}</a>
{% elif key == 'note' %}
<div itemprop="description" <p>{{ value }}</p>
{% elif key == 'tel' %}
<span itemprop="telephone">{{ value }}</span>
{% elif key =='title' %}
<span itemprop="jobTitle">{{ value }}</span>
{% elif key == 'org' %}
<span itemprop="affiliation">{{ value }}</span>
{% elif key == 'photo' %}
<img class="photo" src="{{ value }}"/>
{% else %}
{{ value }}
<span itemprop="{{ key }}">{{ value }}</span>
{% endif %}
</li>
{% endfor %}
{% else %}
<li class="fn">{{ author }}</li>
<li class="url"><a href="{{ SITEURL+'/'+author.url }}">{{ SITEURL+'/'+author.url }}</a></li>
<li class="fn" itemprop="name">{{ author }}</li>
<li class="url"><a href="{{ SITEURL+'/'+author.url }}" itemprop="url" >{{ SITEURL+'/'+author.url }}</a></li>
{% endif %}
</ul>
{% if props %}
@ -51,3 +62,4 @@ <h3><a href="{{ SITEURL+'/'+author.url }}">{{ author }}</a></h3>
</div>
</div>
</li>

View File

@ -1,15 +1,16 @@
<li class="row">
<li class="row" itemprop="itemListElement" itemscope itemtype="http://schema.org/Article">
<div class="article">
<div class="small-4 columns">
{% if article.image %}
<a class="th" href="{{ SITEURL }}/{{ article.url }}"><img src="{{ SITEURL }}/static/{{article.image}}"/></a>
<a class="th" href="{{ SITEURL }}/{{ article.url }}"><img src="{{ SITEURL }}/static/{{article.image}}" itemprop="image" /></a>
{% else %}
<a class="th" href="{{ SITEURL }}/{{ article.url }}"><img src="{{ SITEURL }}/{{ FAVICON }}"/></a>
{% endif %}
</div>
<div class="small-12 columns">
<header>
<h3><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title|title }}</a></h3>
<h3 itemprop="headline"><a href="{{ SITEURL }}/{{ article.url }}" itemprop="url">{{ article.title|title }}</a></h3>
<meta itemprop="name" content="{{ article.title }}"/>
{% if not category %}
<div><span>Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></span></div>
{% endif %}
@ -30,9 +31,9 @@ <h3><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title|title }}</a></h3>
</div>
<footer>
<ul class="no-bullet">
<li>Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> on: <abbr class="published" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</abbr></li>
<li>Published by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><a href="{{ SITEURL }}/{{ article.author.url }}" itemprop="url"><span itemprop="name">{{ article.author }}</span></a></span> on: <abbr class="published" title="{{ article.date.isoformat() }}" itemprop="datePublished">{{ article.locale_date }}</abbr></li>
{% if article.modified %}
<li>Last Modified on: <abbr title="{{ article.modified }}">{{ article.modified }}</abbr></li>
<li>Last Modified on: <abbr title="{{ article.modified }}" itemprop="dateModified">{{ article.modified }}</abbr></li>
{% endif %}
</ul>
</footer>

View File

@ -1,6 +1,4 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - Archives{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark" title="Permalink to archives">Archives</a>{% endblock %}
{% block content %}
<dl class="item-list">
{% for article in articles %}
@ -22,3 +20,4 @@
{% endfor %}
</dl>
{% endblock %}

View File

@ -1,9 +1,8 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{author}}{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ author.url }}" rel="bookmark">{{author}}</a>{% endblock %}
{% block content %}
<ul class="item-list">
<ul class="item-list featured" itemscope itemtype="http://schema.org/ItemList">
{% include '_author_item.html' %}
</ul>
{{ super() }}
{% endblock %}

View File

@ -1,11 +1,13 @@
{% extends 'base.html' %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark">Authors</a>{% endblock %}
{% block content %}
{% if authors %}
<ul class="item-list">
<ul class="item-list" itemscope itemtype="http://schema.org/ItemList">
<meta itemprop="name" content="Authors"/>
<meta itemprop="itemListOrder" content="Unordered"/>
{% for author, articles in authors %}
{% include '_author_item.html' %}
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@ -1,11 +1,10 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - Categories{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark">Categories</a>{% endblock %}
{% block content %}
<h2>Recent Articles by Category</h2>
{% for cat, articles in categories %}
<h3><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></h3>
<ul class="item-list">
<ul class="item-list" itemscope itemtype="http://schema.org/ItemList">
<meta itemprop="name" content="{{ cat }} recent articles"/>
{% for article in articles[0:3] %}
{% include '_list_item.html' %}
{% endfor %}

View File

@ -1,4 +1,2 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{ category }}{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ category.url }}" rel="bookmark">{{ category }}</a>{% endblock %}

View File

@ -1,12 +1,10 @@
{% extends 'base.html' %}
{% block content_title %}
<a href="{{ SITEURL }}/index.html" rel="bookmark">{{ SITENAME }}</a>
{% endblock %}
{% block content %}
<p>{{ SITE_DESCR }}</p>
{% if articles and ARTICLES_ON_INDEX %}
<h2>Recent Articles:</h2>
<ul class="item-list">
<ul class="item-list" itemscope itemtype="http://schema.org/ItemList">
<meta name="Recent Articles"/>
{% for article in articles[0:ARTICLES_ON_INDEX] %}
{% include '_list_item.html' %}
{% endfor %}

View File

@ -1,8 +1,13 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{ page.title|title }}{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page.url }}" rel="bookmark">{{ page.title|title }}</a>{% endblock %}
{% block content_image %}
{% if page.image %}
<a class="th" href="{{ SITEURL }}/static/{{ article.image }}">
<img src="{{ SITEURL }}/static/{{ article.image }}" itemprop="image"/>
</a>
{% endif %}
{% endblock %}
{% block content %}
<article>
<article itemprop="text">
{{ page.content }}
</article>
<footer class="page_footer">

View File

@ -1,3 +1,2 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{ tag }} {% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ tag.url }}" rel="bookmark">{{ tag }}</a>{% endblock %}

View File

@ -1,6 +1,4 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - Tags{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark">Tags</a>{% endblock %}
{% block content %}
<p>A list of all tags with article counts is below:</p>
<ul class="tag-list">