mirror of
https://github.com/WatchOutNewsAgency/wona.github.com.git
synced 2026-01-01 01:16:26 +00:00
Showing each post for each cat
This commit is contained in:
7
_data/homepage_categories.yaml
Normal file
7
_data/homepage_categories.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- phekingnews
|
||||||
|
- editorial
|
||||||
|
- coverstory
|
||||||
|
- bigstory
|
||||||
|
- verbatim
|
||||||
|
- almostfamous
|
||||||
@ -249,6 +249,7 @@ body {
|
|||||||
top: -0.1 * $article-cover-img-height;
|
top: -0.1 * $article-cover-img-height;
|
||||||
background: $featured-articles-bg-color;
|
background: $featured-articles-bg-color;
|
||||||
width: 0.9 * $article-cover-img-width; ;
|
width: 0.9 * $article-cover-img-width; ;
|
||||||
|
height: 120px;
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
20
index.html
20
index.html
@ -16,7 +16,7 @@ title: "Home"
|
|||||||
</div>
|
</div>
|
||||||
<div class="details text-center ">
|
<div class="details text-center ">
|
||||||
<h3 class="title">{{ post.title | truncatewords: 4}}</h3>
|
<h3 class="title">{{ post.title | truncatewords: 4}}</h3>
|
||||||
<p class="tag">{{ post.tag}}</p>
|
<p class="tag">{{ post.subcategory }}</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -28,30 +28,28 @@ title: "Home"
|
|||||||
<div id="featured-articles" class=" container">
|
<div id="featured-articles" class=" container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h1 class="col-sm-12" id="featured-articles-title">Featured Articles</h1>
|
<h1 class="col-sm-12" id="featured-articles-title">Featured Articles</h1>
|
||||||
{% for cat in site.categories %}
|
{% for tag in site.data.homepage_categories %}
|
||||||
{{ cat | inspect }}
|
{% assign posts = site.posts | where: "tag", tag %}
|
||||||
{% assign post = cat.second.first %}
|
{% for post in posts %}
|
||||||
{% if post.categories contains 'wona' and post.image != null %}
|
{% if post.image != null %}
|
||||||
<div class="article-container col-sm-4">
|
<div class="article-container col-sm-4">
|
||||||
<div class="article {{post.tag}}">
|
<div class="article {{post.tag}}">
|
||||||
|
|
||||||
<a href="{{ post.url }}">
|
<a href="{{ post.url }}">
|
||||||
{% if post.image %}
|
|
||||||
<div class="center-fill-container article-cover-container">
|
<div class="center-fill-container article-cover-container">
|
||||||
<img src="/images/posts/{{ post.image }}" class="img-center-fill {% if post.image == null %}hidden{% endif %}">
|
<img src="/images/posts/{{ post.image }}" class="img-center-fill {% if post.image == null %}hidden{% endif %}">
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
|
||||||
<br><br>
|
|
||||||
{% endif %}
|
|
||||||
<div class="details text-center">
|
<div class="details text-center">
|
||||||
<span class="tag">{{ post.tag }}</span>
|
<span class="tag">{{ post.tag }}</span>
|
||||||
<h3 class="title">{{ post.title | truncatewords: 4}}</h3>
|
<h3 class="title">{{ post.title | truncatewords: 4}}</h3>
|
||||||
<p class="excerpt">{{ post.excerpt | markdownify | truncate: 75 }}</p>
|
<p class="excerpt">{% if post.excerpt != null %}{{ post.excerpt | markdownify | truncate: 75 }}{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% break %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user