Update templates. Add support for canonical URLs.
This commit is contained in:
parent
2515b2a646
commit
118398c3f0
7 changed files with 15 additions and 12 deletions
|
@ -7,7 +7,7 @@
|
||||||
{% block blog_meta %}
|
{% block blog_meta %}
|
||||||
<ul class="post-detail">
|
<ul class="post-detail">
|
||||||
<li>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
{{ post.date_published|date:"M d, Y" }}
|
{{ post.date_published|date:"M d, Y" }}
|
||||||
|
@ -16,12 +16,12 @@
|
||||||
<ul class="post-detail tags">
|
<ul class="post-detail tags">
|
||||||
{% if post.categories.exists %}
|
{% if post.categories.exists %}
|
||||||
{% for category in post.categories.all %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if post.tags.exists %}
|
{% if post.tags.exists %}
|
||||||
{% for tag in post.tags.all %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
<ul class="blog-archive">
|
<ul class="blog-archive">
|
||||||
{% for year in years %}
|
{% for year in years %}
|
||||||
<li{% if year.grouper == current_year %} class="active"{% endif %}>
|
<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>
|
<ul>
|
||||||
{% for month in year.list %}
|
{% for month in year.list %}
|
||||||
<li{% if year.grouper == current_year and month.date.month == current_month %} class="active"{% else %} class="month"{% endif %}>
|
<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" }}
|
{{ month.date|date:"F" }}
|
||||||
<span>(
|
<span>(
|
||||||
{% if month.count > 0 %}
|
{% if month.count > 0 %}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<h3>{% trans "Authors" %}</h3>
|
<h3>{% trans "Authors" %}</h3>
|
||||||
<ul class="blog-authors">
|
<ul class="blog-authors">
|
||||||
{% for author in instance.get_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 }}
|
{{ author.get_full_name }}
|
||||||
<span>(
|
<span>(
|
||||||
{% if author.count > 0 %}
|
{% if author.count > 0 %}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<h3>{% trans "Categories" %}</h3>
|
<h3>{% trans "Categories" %}</h3>
|
||||||
<ul class="blog-categories">
|
<ul class="blog-categories">
|
||||||
{% for category in 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 }}
|
{{ category.name }}
|
||||||
<span>(
|
<span>(
|
||||||
{% if category.count > 0 %}
|
{% if category.count > 0 %}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<h3>{% trans "Tags" %}</h3>
|
<h3>{% trans "Tags" %}</h3>
|
||||||
<ul class="blog-tags">
|
<ul class="blog-tags">
|
||||||
{% for tag in 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 }}
|
{{ tag.name }}
|
||||||
<span>(
|
<span>(
|
||||||
{% if tag.count > 0 %}
|
{% if tag.count > 0 %}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %}
|
{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %}
|
||||||
{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %}
|
{% 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 %}
|
{% block content_blog %}{% spaceless %}
|
||||||
<article id="post-{{ post.slug }}" class="post-item post-detail">
|
<article id="post-{{ post.slug }}" class="post-item post-detail">
|
||||||
|
@ -12,7 +13,7 @@
|
||||||
{% block blog_meta %}
|
{% block blog_meta %}
|
||||||
<ul class="post-detail">
|
<ul class="post-detail">
|
||||||
<li>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
{{ post.date_published|date:"M d, Y" }}
|
{{ post.date_published|date:"M d, Y" }}
|
||||||
|
@ -21,12 +22,12 @@
|
||||||
<ul class="post-detail tags">
|
<ul class="post-detail tags">
|
||||||
{% if post.categories.exists %}
|
{% if post.categories.exists %}
|
||||||
{% for category in post.categories.all %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if post.tags.exists %}
|
{% if post.tags.exists %}
|
||||||
{% for tag in post.tags.all %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{% extends "djangocms_blog/base.html" %}
|
{% extends "djangocms_blog/base.html" %}
|
||||||
{% load i18n thumbnail %}{% spaceless %}
|
{% load i18n thumbnail %}{% spaceless %}
|
||||||
|
|
||||||
|
{% block canonical_url %}<link rel="canonical" href="{{ SITE.domain }}{{ view.get_view_url }}"/>{% endblock canonical_url %}
|
||||||
|
|
||||||
{% block content_blog %}
|
{% block content_blog %}
|
||||||
<section class="blog-list">
|
<section class="blog-list">
|
||||||
{% block blog_title %}
|
{% block blog_title %}
|
||||||
|
@ -19,7 +21,7 @@
|
||||||
<p class="blog-empty">{% trans "No article found." %}</p>
|
<p class="blog-empty">{% trans "No article found." %}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if author or archive_date or tagged_entries %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if is_paginated %}
|
{% if is_paginated %}
|
||||||
|
|
Loading…
Reference in a new issue