|
1 | 1 | {% if include.categoryName == "Latest Articles" %} |
2 | | - {% assign featuredPosts = site.tags.featured %} |
| 2 | + {% assign featuredPosts = site.tags.featured %} |
3 | 3 | {% else %} |
4 | | - {% assign featuredPosts = '' | split: '' %} |
5 | | - {% for post in include.postsToFilter %} |
6 | | - {% if post.tags contains 'featured' %} |
7 | | - {% assign featuredPosts = featuredPosts | push: post %} |
8 | | - {% endif %} |
9 | | - {% endfor %} |
| 4 | + {% assign featuredPosts = '' | split: '' %} |
| 5 | + {% for post in include.postsToFilter %} |
| 6 | + {% if post.tags contains 'featured' %} |
| 7 | + {% assign featuredPosts = featuredPosts | push: post %} |
| 8 | + {% endif %} |
| 9 | + {% endfor %} |
10 | 10 | {% endif %} |
11 | 11 | {% assign numPosts = featuredPosts | size %} |
12 | | -{% if numPosts >= 2 %} |
13 | | -<div class="featured-posts grid-x grid-margin-x grid-margin-y"> |
14 | | - {% for post in featuredPosts limit:2 %} |
15 | | - <div class="featured-post {% include post_colour.html post=post %} cell large-6 grid-x"> |
16 | | - <div class="summary cell large-8 medium-10 small-11 grid-y align-center"> |
17 | | - <div class="cell">{% include category_display.html post = post %}</div> |
18 | | - <h3 class="cell"> |
19 | | - <a href='{{ site.baseurl }}{{ post.url }}'>{{ post.title }}</a> |
20 | | - {% include post_summary_social.html post=post %} |
21 | | - </h3> |
22 | | - <div class="cell">{{ post.summary }}</div> |
23 | | - <div class="avatar-metadata cell"> |
24 | | - {% assign author = site.data.authors.authors[post.author] %} |
25 | | - {% include author_picture.html %} |
26 | | - {% include post_metadata.html post=post %} |
27 | | - </div> |
| 12 | +{% if numPosts > 0 %} |
| 13 | + <div class="featured-posts grid-x grid-margin-x grid-margin-y"> |
| 14 | + {% assign topPost = featuredPosts[0] %} |
| 15 | + <div class="featured-post {% include post_colour.html post=topPost %} cell large-12 grid-x"> |
| 16 | + {% include featured_post.html post=topPost %} |
| 17 | + </div> |
| 18 | + |
| 19 | + {% if numPosts >= 3 %} |
| 20 | + {% assign splitPosts = featuredPosts | slice: 1, 2 %} |
| 21 | + {% for post in splitPosts %} |
| 22 | + <div class="featured-post {% include post_colour.html post=post %} cell large-6 grid-x"> |
| 23 | + {% include featured_post.html post=post %} |
| 24 | + </div> |
| 25 | + {% endfor %} |
| 26 | + {% endif %} |
28 | 27 | </div> |
29 | | - <div class="shape cell large-4 medium-2 small-1 grid-y align-center"> |
30 | | - {% capture shape %}{% include post_shape.html post=post %}{% endcapture %} |
31 | | - {% assign shape = shape | strip %} |
32 | | - {% case shape %} |
33 | | - {% when "shape1" %} |
34 | | - <svg class="bg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 465" preserveAspectRatio="none"> |
35 | | - <polygon points="0 0 650 132.977 499.388 465 0 465"/> |
36 | | - </svg> |
37 | | - {% when "shape2" %} |
38 | | - <svg class="bg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 410" preserveAspectRatio="none"> |
39 | | - <polygon points="0 0 350 0 650 300 650 410 0 410"/> |
40 | | - </svg> |
41 | | - {% when "shape3" %} |
42 | | - <svg class="bg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 410" preserveAspectRatio="none"> |
43 | | - <polygon points="0,0 400,0 850,500 0,950"/> |
44 | | - </svg> |
45 | | - {% when "shape4" %} |
46 | | - <svg class="bg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 410" preserveAspectRatio="none"> |
47 | | - <path d="M0 0h542l108 87v183L420 465H0z" /> |
48 | | - </svg> |
49 | | - {% else %} |
50 | | - <svg class="bg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 410" preserveAspectRatio="none"> |
51 | | - <polygon points="0 0 650 0 650 109.736 353 410 0 410"/> |
52 | | - </svg> |
53 | | - {% endcase %} |
54 | | - {% if post.image and post.featuredImage %} |
55 | | - {% capture image-path %}{{ site.baseurl }}/{{post.image}}{% endcapture %} |
56 | | - <img class="cell show-for-large" alt="thumbnail of post: '{{post.title}}'" src="{{ image-path | replace: "//", "/" }}"/> |
57 | | - {% endif %} |
58 | | - </div> |
59 | | - </div> |
60 | | - {% endfor %} |
61 | | -</div> |
62 | 28 | {% endif %} |
0 commit comments