Update templates. Add support for canonical URLs.

This commit is contained in:
Iacopo Spalletti 2014-03-23 16:23:16 +01:00
parent 2515b2a646
commit 118398c3f0
7 changed files with 15 additions and 12 deletions

View File

@ -7,7 +7,7 @@
{% block blog_meta %}
<ul class="post-detail">
<li>
{% trans "by" %} <a href="{% url 'djangocms_blog:author-posts' post.author.username %}">{{ post.author.get_full_name }}</a>
{% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.username %}">{{ post.author.get_full_name }}</a>
</li>
<li>
{{ post.date_published|date:"M d, Y" }}
@ -16,12 +16,12 @@
<ul class="post-detail tags">
{% if post.categories.exists %}
{% for category in post.categories.all %}
<li class="category_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:category-posts' category=category.slug %}" class="blog-categories-{{ category.count }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
<li class="category_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endfor %}
{% endif %}
{% if post.tags.exists %}
{% for tag in post.tags.all %}
<li class="tag_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:tagged-posts' tag=tag.slug %}" class="blog-tag blog-tag-{{ tag.count }}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}</li>
<li class="tag_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-tagged' tag=tag.slug %}" class="blog-tag blog-tag-{{ tag.count }}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endfor %}
{% endif %}
</ul>

View File

@ -7,11 +7,11 @@
<ul class="blog-archive">
{% for year in years %}
<li{% if year.grouper == current_year %} class="active"{% endif %}>
<a href="{% url 'djangocms_blog:archive-year' year=year.grouper %}">{{ year.grouper }}</a>
<a href="{% url 'djangocms_blog:posts-archive' year=year.grouper %}">{{ year.grouper }}</a>
<ul>
{% for month in year.list %}
<li{% if year.grouper == current_year and month.date.month == current_month %} class="active"{% else %} class="month"{% endif %}>
<a href="{% url 'djangocms_blog:archive-month' year=year.grouper month=month.date|date:"n" %}">
<a href="{% url 'djangocms_blog:posts-archive' year=year.grouper month=month.date|date:"n" %}">
{{ month.date|date:"F" }}
<span>(
{% if month.count > 0 %}

View File

@ -3,7 +3,7 @@
<h3>{% trans "Authors" %}</h3>
<ul class="blog-authors">
{% for author in instance.get_authors %}
<li><a href="{% url 'djangocms_blog:author-posts' author.username %}">
<li><a href="{% url 'djangocms_blog:posts-author' author.username %}">
{{ author.get_full_name }}
<span>(
{% if author.count > 0 %}

View File

@ -4,7 +4,7 @@
<h3>{% trans "Categories" %}</h3>
<ul class="blog-categories">
{% for category in categories %}
<li><a href="{% url 'djangocms_blog:category-posts' category=category.slug %}" class="blog-categories-{{ category.count }}">
<li><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }}">
{{ category.name }}
<span>(
{% if category.count > 0 %}

View File

@ -4,7 +4,7 @@
<h3>{% trans "Tags" %}</h3>
<ul class="blog-tags">
{% for tag in tags %}
<li><a href="{% url 'djangocms_blog:tagged-posts' tag=tag.slug %}" class="blog-tag-{{ tag.count }}">
<li><a href="{% url 'djangocms_blog:posts-tagged' tag=tag.slug %}" class="blog-tag-{{ tag.count }}">
{{ tag.name }}
<span>(
{% if tag.count > 0 %}

View File

@ -4,6 +4,7 @@
{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %}
{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %}
{% block canonical_url %}<link rel="canonical" href="{{ SITE.domain }}{{ view.get_view_url }}"/>{% endblock canonical_url %}
{% block content_blog %}{% spaceless %}
<article id="post-{{ post.slug }}" class="post-item post-detail">
@ -12,7 +13,7 @@
{% block blog_meta %}
<ul class="post-detail">
<li>
{% trans "by" %} <a href="{% url 'djangocms_blog:author-posts' post.author.username %}">{{ post.author.get_full_name }}</a>
{% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.username %}">{{ post.author.get_full_name }}</a>
</li>
<li>
{{ post.date_published|date:"M d, Y" }}
@ -21,12 +22,12 @@
<ul class="post-detail tags">
{% if post.categories.exists %}
{% for category in post.categories.all %}
<li class="category_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:category-posts' category=category.slug %}" class="blog-categories-{{ category.count }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
<li class="category_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endfor %}
{% endif %}
{% if post.tags.exists %}
{% for tag in post.tags.all %}
<li class="tag_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:tagged-posts' tag=tag.slug %}" class="blog-tag blog-tag-{{ tag.count }}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}</li>
<li class="tag_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-tagged' tag=tag.slug %}" class="blog-tag blog-tag-{{ tag.count }}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endfor %}
{% endif %}
</ul>

View File

@ -1,6 +1,8 @@
{% extends "djangocms_blog/base.html" %}
{% load i18n thumbnail %}{% spaceless %}
{% block canonical_url %}<link rel="canonical" href="{{ SITE.domain }}{{ view.get_view_url }}"/>{% endblock canonical_url %}
{% block content_blog %}
<section class="blog-list">
{% block blog_title %}
@ -19,7 +21,7 @@
<p class="blog-empty">{% trans "No article found." %}</p>
{% endfor %}
{% if author or archive_date or tagged_entries %}
<p class="blog-back"><a href="{% url 'djangocms_blog:latest-posts' %}">{% trans "Back" %}</a></p>
<p class="blog-back"><a href="{% url 'djangocms_blog:posts-latest' %}">{% trans "Back" %}</a></p>
{% endif %}
{% if is_paginated %}