Removing the blogPost and blogPosts component, replace with template equivalent

This commit is contained in:
pcvonz
2017-09-22 10:52:06 -07:00
parent 7c95602b21
commit 076b8399e7
2 changed files with 38 additions and 5 deletions

View File

@@ -11,9 +11,34 @@ categoryPage = "article"
<div class="container">
<h1 class="intro-title"></h1>
<div class="row news-section">
{% component 'blogPost' %}
</div>
<div class="col-md-3 text-center">
<span class="date-big">{{ post.published_at|date('d') }}</span><br/>
<span class="date-small">{{ post.published_at|date('M Y') }}</span>
<br/><br/>
<p><img src="{{ post.user.avatar.path }}" width="100px"/>
<br/>{{ post.user.full_name }}</p>
</div>
<div class="col-md-6">
<h1>{{ post.title }}</h1>
{% if post.featured_images.count %}
<div class="featured-images text-center">
{% for image in post.featured_images %}
<p>
<img
data-src="{{ image.filename }}"
src="{{ image.path }}"
alt="{{ image.description }}"
style="width:100%" />
</p>
{% endfor %}
</div>
{% endif %}
{{ post.content_html|raw }}
</div>
</div>
<div class="col-md-3">&nbsp;</div>
</div>
</div>
{% partial "footer" %}
</html>
</html>

View File

@@ -13,6 +13,7 @@ postPage = "{{ :slug }}"
<html>
{% partial "head" %}
{% partial "header" %}
{% set posts = blogPosts.posts %}
<div class="jumbotron-filter"></div>
<div class="jumbotron">
<div class="container">
@@ -32,7 +33,14 @@ postPage = "{{ :slug }}"
</div>
<div class="col-md-6 news-list">
<h2>Latest news</h2>
{% component 'blogPosts' %}
{% for post in posts %}
<article class="news">
<div class="news-date"> {{ post.updated_at|date("M d, Y") }} </div>
<div class="news-title">
<a href="{{ 'article'|page({ slug: post.slug }) }}">{{ post.title }}</a>
</div>
</article>
{% endfor %}
<a class="more-news" href="/news">More news »</a>
</div>
</div>
@@ -138,4 +146,4 @@ postPage = "{{ :slug }}"
</div>
</div>
{% partial "footer" %}
</html>
</html>