Added description for category on blog list and fixed single post
This commit is contained in:
parent
eb46f9fcb3
commit
488ea1ad4d
|
@ -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)])
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
.title {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
|
@ -8,6 +8,8 @@
|
||||||
@import "components/footer";
|
@import "components/footer";
|
||||||
@import "components/feeds";
|
@import "components/feeds";
|
||||||
|
|
||||||
|
@import "components/blog";
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//Django Toolbar//
|
//Django Toolbar//
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue