-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.html
57 lines (53 loc) · 2.33 KB
/
blog.html
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: Blog
layout: default
scripts:
- blog.js
---
<div id="searchSection">
<input type="text" id="searchBar" placeholder="Search" autofocus autocomplete="off" oninput="blogSearchFilter()">
<img src="/assets/images/search/search.png" alt="magnifying glass icon">
</div>
<br>
<span class="tagList" id="tagFilterList">
Filter by tag: <span onclick="blogTagFilter('none');" class="tagLabel none" tabindex="0">none</span>
{% for tag in site.tags %}
<span onclick="blogTagFilter('{{ tag[0] }}');" class="tagLabel {{ tag[0] }}" tabindex="0">{{ tag[0] }}</span>
{% endfor %}
</span>
<div id="blogList">
{% for post in site.posts %}
<a href="{{ post.url | relative_url }}" tabindex="0">
<img src="/assets/images/blog-icons/{{ post.title | slugify }}.webp" alt="{{ post.icon_alt }}">
<h3>{{ post.title }}</h3>
<div class="postMetaLine">
<span class="tagList">
{% for tag in site.tags %}
{% if post.tags contains tag[0] %}
<span class="tagLabel {{ tag[0] }}">{{ tag[0] }}</span>
{% endif %}
{% endfor %}
</span>
<br>{{ post.date | date_to_string }}<time datetime="{{ post.date | date_to_xmlschema }}" class="relativePostTime">{{ post.date | date_to_xmlschema }}</time>
</div>
<p>
{% assign excerpt_words = post.excerpt | strip_html | split: " " %}
{% assign running_length = 0 %}
{% assign result_excerpt = "" %}
{% for excerpt_word in excerpt_words %}
{% assign word_size = excerpt_word | size %}
{% assign running_length = running_length | plus: word_size %}
{% if running_length > 200 %}
{% assign result_excerpt = result_excerpt | append: "..." %}
{% break %}
{% endif %}
{% assign result_excerpt = result_excerpt | append: " " %}
{% assign result_excerpt = result_excerpt | append: excerpt_word %}
{% endfor %}
{{ result_excerpt }}
</p>
</a>
{% endfor %}
</div>
<p id="noResults">No results found.</p>
{% include subscribe.html %}