Added description for category on blog list and fixed single post

This commit is contained in:
Sam Collins 2017-03-29 20:27:51 +01:00
parent eb46f9fcb3
commit 488ea1ad4d
No known key found for this signature in database
GPG Key ID: 233C5943C800FE30
6 changed files with 24 additions and 19 deletions

View File

@ -45,8 +45,8 @@ class Post(models.Model):
"height": 150, "height": 150,
"crop": True}, "crop": True},
'full': { 'full': {
"width": 730, "width": 825,
"height": 410, "height": 450,
"crop": True}}, "crop": True}},
validators=[ validators=[
MinSizeValidator(730, 410)]) MinSizeValidator(730, 410)])

View File

@ -0,0 +1,7 @@
.title {
margin-bottom: 0;
}
.thumbnail {
margin-bottom: 15px;
}

View File

@ -8,6 +8,8 @@
@import "components/footer"; @import "components/footer";
@import "components/feeds"; @import "components/feeds";
@import "components/blog";
//////////////////////////////// ////////////////////////////////
//Django Toolbar// //Django Toolbar//
//////////////////////////////// ////////////////////////////////

View File

@ -4,15 +4,15 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-sm-8"> <div class="col-md-9">
<article itemscope itemtype="http://schema.org/Article"> <article itemscope itemtype="http://schema.org/Article">
<a href="{{ post.get_absolute_url }}"><h1 itemprop="name">{{ post.title }}</h1></a> <a href="{{ post.get_absolute_url }}"><h1 class="title" itemprop="name">{{ post.title }}</h1></a>
{% include "blog/post_date.html" %} {% include "blog/post_date.html" %}
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject"> <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="{{ post.image.url }}" class="img-fluid"/> <img src="{{ post.image.full.url }}" class="img-fluid"/>
<meta itemprop="url" content="{{ post.image.url }}"> <meta itemprop="url" content="{{ post.image.full.url }}">
<meta itemprop="width" content="{{ post.image.width }}"> <meta itemprop="width" content="{{ post.image.full.width }}">
<meta itemprop="height" content="{{ post.image.height }}"> <meta itemprop="height" content="{{ post.image.full.height }}">
</div> </div>
<span itemprop="articleBody">{{ post.description|safe_markdown }}</span> <span itemprop="articleBody">{{ post.description|safe_markdown }}</span>
</article> </article>

View File

@ -3,16 +3,12 @@
{% block title %}Blog Posts{% endblock %} {% block title %}Blog Posts{% endblock %}
{% block content %} {% block content %}
<style>
.thumbnail {
margin-bottom: 15px;
}
.title {
margin-bottom: 0;
}
</style>
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
{% if view.category %}
<h1>{{ view.category.name }}</h1>
<p>{{ view.category.description }}</p>
{% endif %}
{% for post in posts %} {% for post in posts %}
<article class="row post" itemscope itemtype="http://schema.org/Article"> <article class="row post" itemscope itemtype="http://schema.org/Article">
<div class="col-md-4 thumbnail" itemprop="image" itemscope itemtype="https://schema.org/ImageObject"> <div class="col-md-4 thumbnail" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">

View File

@ -6,5 +6,5 @@
<a href="{{ category.get_absolute_url }}" class="list-group-item list-group-item-action">{{ category.name }}</a> <a href="{{ category.get_absolute_url }}" class="list-group-item list-group-item-action">{{ category.name }}</a>
{% endfor %} {% endfor %}
</ul> </ul>
<a href="{% url "blog-rss" %}"><i class="fa fa-rss-square"> RSS Feed</i></a> <a href="{% url "blog-rss" %}"><i class="fa fa-rss-square"></i> RSS Feed</a>
</div> </div>