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,
|
||||
"crop": True},
|
||||
'full': {
|
||||
"width": 730,
|
||||
"height": 410,
|
||||
"width": 825,
|
||||
"height": 450,
|
||||
"crop": True}},
|
||||
validators=[
|
||||
MinSizeValidator(730, 410)])
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
.title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
margin-bottom: 15px;
|
||||
}
|
|
@ -8,6 +8,8 @@
|
|||
@import "components/footer";
|
||||
@import "components/feeds";
|
||||
|
||||
@import "components/blog";
|
||||
|
||||
////////////////////////////////
|
||||
//Django Toolbar//
|
||||
////////////////////////////////
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -3,22 +3,18 @@
|
|||
{% 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">
|
||||
<picture>
|
||||
<source class="img-fluid" srcset="{{ post.image.mobilethumb.url }}" media="(max-width: 780px)" />
|
||||
<source class="img-fluid" srcset="{{ post.image.thumbnail.url }}" />
|
||||
<source class="img-fluid" srcset="{{ post.image.mobilethumb.url }}" media="(max-width: 780px)"/>
|
||||
<source class="img-fluid" srcset="{{ post.image.thumbnail.url }}"/>
|
||||
<img class="img-fluid" src="{{ post.image.thumbnail.url }}" alt="{{ banner.title }}">
|
||||
</picture>
|
||||
</div>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue