Repository navigation
Expand file tree
/
Copy pathnews.html
More file actions
40 lines (35 loc) · 1.48 KB
/
Copy pathnews.html
File metadata and controls
40 lines (35 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class="well">
<h4><b>Latest News</b></h4>
<div style="height: 300px; overflow-y: auto;">
{%- capture raw_items -%}
{%- for item in site.data.news -%}
{{ item.date | date: "%Y-%m-%d" }}|{{ item.headline }}|{{ item.link }}|::
{%- endfor -%}
{%- for post in site.posts -%}
{%- if post.tags contains 'announcement' -%}
{{ post.date | date: "%Y-%m-%d" }}|{{ post.title }}|{{ post.url | prepend: site.baseurl }}|BLOG::
{%- endif -%}
{%- endfor -%}
{%- endcapture -%}
{% assign news_array = raw_items | split: "::" | sort | reverse %}
{% for entry in news_array limit:5 %}
{% assign details = entry | split: "|" %}
{% assign item_date = details[0] | strip %}
{% assign item_title = details[1] | strip %}
{% assign item_link = details[2] | strip %}
{% assign item_type = details[3] | strip %}
{% if item_title != "" %}
<p style="margin-bottom: 12px; line-height: 1.3;">
<small class=" {% if item_type == 'BLOG' %}label label-primary{% else %}label-default{% endif %}"
style="font-size: 8px; vertical-align: middle; margin-right: 5px;">
{{ item_type }}
</small>
<a href="{{ item_link }}">{{ item_title }}</a>
<br>
{% include date.html date=item_date %}
</p>
{% endif %}
{% endfor %}
</div>
<h4><a href="{{ site.url }}{{ site.baseurl }}/allnews">... see all news</a></h4>
</div>