forked from DDMAL/ddmal.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.html
52 lines (45 loc) · 1.49 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
---
title: Blog
layout: page
tab: Blog
---
<!-- <ul>
{% for post in site.posts %}
<li>
<a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul> -->
<div class="container">
{% for post in site.posts %}
<div class="post-container">
<div class="post-title row">
<div class="col-sm-12">
<a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a>
</div>
<div class="col-sm-12"><br></div>
<div class="col-sm-12">
{{ post.date | date: "%b %d, %y" }}
</div>
</div>
<div class="post-excerpt">
{% assign preprocessed_content=post.content | replace: '<p>', '__p__' %}
{% assign preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign preprocessed_content=preprocessed_content | replace: '<a', '__a__' %}
{% assign preprocessed_content=preprocessed_content | replace: '</a>', '__/a__' %}
{% assign truncated_content=preprocessed_content | strip_html | truncatewords:150 %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}
{% assign cleaned_content=cleaned_content | replace: '__a__', '<a' %}
{% assign cleaned_content=cleaned_content | replace: '__/a__', '</a>' %}
{{ cleaned_content }}
<br />
<p>
<a href="{{ site.url }}{{ post.url }}">Read more</a>
</p>
</div>
</div>
<hr>
{% endfor %}
</div>
<!-- -->