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,
"crop": True},
'full': {
"width": 730,
"height": 410,
"width": 825,
"height": 450,
"crop": True}},
validators=[
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/feeds";
@import "components/blog";
////////////////////////////////
//Django Toolbar//
////////////////////////////////

View File

@ -4,15 +4,15 @@
{% block content %}
<div class="row">
<div class="col-sm-8">
<div class="col-md-9">
<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" %}
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="{{ post.image.url }}" class="img-fluid"/>
<meta itemprop="url" content="{{ post.image.url }}">
<meta itemprop="width" content="{{ post.image.width }}">
<meta itemprop="height" content="{{ post.image.height }}">
<img src="{{ post.image.full.url }}" class="img-fluid"/>
<meta itemprop="url" content="{{ post.image.full.url }}">
<meta itemprop="width" content="{{ post.image.full.width }}">
<meta itemprop="height" content="{{ post.image.full.height }}">
</div>
<span itemprop="articleBody">{{ post.description|safe_markdown }}</span>
</article>

View File

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