File tree 5 files changed +77
-4
lines changed
5 files changed +77
-4
lines changed Original file line number Diff line number Diff line change 2
2
< html >
3
3
< head >
4
4
< title > {% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</ title >
5
-
5
+ < link rel =" icon " type =" image/png " href =" ../favicon.ico " />
6
6
{% include meta.html %}
7
7
8
8
<!--[if lt IE 9]>
11
11
12
12
< link rel ="stylesheet " type ="text/css " href ="{{ site.baseurl }}/style.css " />
13
13
< link rel ="alternate " type ="application/rss+xml " title ="{{ site.name }} - {{ site.description }} " href ="{{ site.baseurl }}/feed.xml " />
14
- < link rel =" icon " type =" image/png " href =" ../favicon.ico " />
14
+
15
15
<!-- Created with Jekyll Now - http://github.com/barryclark/jekyll-now -->
16
16
</ head >
17
17
@@ -28,6 +28,7 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
28
28
29
29
< nav >
30
30
< a href ="{{ site.baseurl }}/ "> Blog</ a >
31
+ < a href ="{{ site.baseurl }}/tags "> Tags</ a >
31
32
< a href ="{{ site.baseurl }}/about "> About</ a >
32
33
</ nav >
33
34
</ header >
Original file line number Diff line number Diff line change 5
5
< article class ="post ">
6
6
< h1 > {{ page.title }}</ h1 >
7
7
8
+ < div class ="date3 ">
9
+ Viết bởi {{page.author}} - Vào ngày {{ page.date | date: "%d/%m/%Y" }}
10
+ </ div >
11
+
8
12
< div class ="entry ">
9
13
{{ content }}
10
14
</ div >
11
15
12
- < div class ="date ">
16
+ <!-- <div class="date">
17
+
13
18
Viết bởi {{page.author}} - Vào ngày {{ page.date | date: "%d/%m/%Y" }}
19
+ </div> -->
20
+ < div >
21
+ < small > Tags:</ small >
22
+ {% for tag in page.tags %}
23
+ < a href ="#{{ tag | slugify }} "> {{ tag }} </ a > ,
24
+ {% endfor %}
14
25
</ div >
15
26
16
27
{% include disqus.html %}
Original file line number Diff line number Diff line change 1
1
---
2
2
layout : post
3
3
title : My first post!
4
- categories : category1 category2
5
4
author : <a target="_blank" rel="noopener noreferrer" href="https://google.com">Truong Nguyen V.</a>
5
+ tags : [tag1, tag2]
6
6
---
7
7
8
8
My first post content here
Original file line number Diff line number Diff line change @@ -127,6 +127,13 @@ img {
127
127
// text-align: right;
128
128
}
129
129
130
+ .date3 {
131
+ font-style : italic ;
132
+ color : $gray ;
133
+ font-size : smaller ;
134
+ text-align : right ;
135
+ }
136
+
130
137
// Specify the color of the selection
131
138
::-moz-selection {
132
139
color : $black ;
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout: default
3
+ title: Tag
4
+ ---
5
+
6
+ {% comment %}
7
+ =======================
8
+ The following part extracts all the tags from your posts and sort tags, so that you do not need to manually collect your tags to a place.
9
+ =======================
10
+ {% endcomment %}
11
+ {% assign rawtags = "" %}
12
+ {% for post in site.posts %}
13
+ {% assign ttags = post.tags | join:'|' | append:'|' %}
14
+ {% assign rawtags = rawtags | append:ttags %}
15
+ {% endfor %}
16
+ {% assign rawtags = rawtags | split:'|' | sort %}
17
+
18
+ {% comment %}
19
+ =======================
20
+ The following part removes dulpicated tags and invalid tags like blank tag.
21
+ =======================
22
+ {% endcomment %}
23
+ {% assign tags = "" %}
24
+ {% for tag in rawtags %}
25
+ {% if tag != "" %}
26
+ {% if tags == "" %}
27
+ {% assign tags = tag | split:'|' %}
28
+ {% endif %}
29
+ {% unless tags contains tag %}
30
+ {% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %}
31
+ {% endunless %}
32
+ {% endif %}
33
+ {% endfor %}
34
+
35
+ {% comment %}
36
+ =======================
37
+ The purpose of this snippet is to list all your posts posted with a certain tag.
38
+ ======================
39
+ {% endcomment %}
40
+ {% for tag in tags %}
41
+ < h2 id ="{{ tag | slugify }} "> {{ tag }}</ h2 >
42
+ < ul >
43
+ {% for post in site.posts %}
44
+ {% if post.tags contains tag %}
45
+ < li >
46
+ < a href ="{{ post.url }} "> {{ post.title }}</ a > - < small class ="date3 "> {{ post.date | date: "%d/%m/%Y" }}</ small >
47
+ <!-- {% for tag in post.tags %}
48
+ <a class="tag" href="/blog/tag/#{{ tag | slugify }}">{{ tag }}</a>
49
+ {% endfor %} -->
50
+ </ li >
51
+ {% endif %}
52
+ {% endfor %}
53
+ </ ul >
54
+ {% endfor %}
You can’t perform that action at this time.
0 commit comments