Skip to content

Commit 8d6661e

Browse files
committed
added tags in posts
1 parent c9a8587 commit 8d6661e

5 files changed

Lines changed: 226 additions & 0 deletions

File tree

config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ params:
3131

3232
social: true
3333
socialIcons: # optional
34+
- name: "rss"
35+
url: "https://hanwg.top/index.xml"
3436
- name: "LinkedIn"
3537
url: "https://www.linkedin.com/in/hanwuguang/"
3638
- name: "GitHub"

content/about/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "About Me"
33
layout: "about me"
44
summary: "Han Wuguang's profile, core skills, work experience, certifications and education"
5+
date: 2025-12-11
56
---
67

78
<img src="photo.png#center" alt="profile photo" style="width: 256px;" />

content/side-projects/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "Side Projects"
33
layout: "side projects"
44
summary: "Collection of my personal projects"
5+
date: 2025-12-11
56
---
67
A collection of my side projects.
78
It's a little bare at the moment since I'm still in the midst of filling up this section.

layouts/_default/list.html

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{{- define "main" }}
2+
3+
{{- if (and site.Params.profileMode.enabled .IsHome) }}
4+
{{- partial "index_profile.html" . }}
5+
{{- else }} {{/* if not profileMode */}}
6+
7+
{{- if not .IsHome | and .Title }}
8+
<header class="page-header">
9+
{{- partial "breadcrumbs.html" . }}
10+
<h1>
11+
{{ .Title }}
12+
{{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
13+
{{- with .OutputFormats.Get "rss" }}
14+
<a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
15+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
16+
stroke-linecap="round" stroke-linejoin="round" height="23">
17+
<path d="M4 11a9 9 0 0 1 9 9" />
18+
<path d="M4 4a16 16 0 0 1 16 16" />
19+
<circle cx="5" cy="19" r="1" />
20+
</svg>
21+
</a>
22+
{{- end }}
23+
{{- end }}
24+
</h1>
25+
{{- if .Description }}
26+
<div class="post-description">
27+
{{ .Description | markdownify }}
28+
</div>
29+
{{- end }}
30+
</header>
31+
{{- end }}
32+
33+
{{- if .Content }}
34+
<div class="post-content">
35+
{{- if not (.Param "disableAnchoredHeadings") }}
36+
{{- partial "anchored_headings.html" .Content -}}
37+
{{- else }}{{ .Content }}{{ end }}
38+
</div>
39+
{{- end }}
40+
41+
{{- $pages := union .RegularPages .Sections }}
42+
43+
{{- if .IsHome }}
44+
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
45+
{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }}
46+
{{- end }}
47+
48+
{{- $paginator := .Paginate $pages }}
49+
50+
{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
51+
{{- partial "home_info.html" . }}
52+
{{- end }}
53+
54+
{{- $term := .Data.Term }}
55+
{{- range $index, $page := $paginator.Pages }}
56+
57+
{{- $class := "post-entry" }}
58+
59+
{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }}
60+
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
61+
{{- $class = "first-entry" }}
62+
{{- else if $term }}
63+
{{- $class = "post-entry tag-entry" }}
64+
{{- end }}
65+
66+
<article class="{{ $class }}">
67+
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
68+
{{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
69+
<header class="entry-header">
70+
<h2 class="entry-hint-parent">
71+
{{- .Title }}
72+
{{- if .Draft }}
73+
<span class="entry-hint" title="Draft">
74+
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentColor">
75+
<path
76+
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
77+
</svg>
78+
</span>
79+
{{- end }}
80+
</h2>
81+
</header>
82+
{{- if (ne (.Param "hideSummary") true) }}
83+
<div class="entry-content">
84+
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
85+
</div>
86+
{{- end }}
87+
{{- if not (.Param "hideMeta") }}
88+
<footer class="entry-footer">
89+
{{- partial "post_meta.html" . -}}
90+
</footer>
91+
{{- end }}
92+
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
93+
94+
{{- /* Customization: Add tags */ -}}
95+
{{- if .Params.tags }}
96+
<div class="tags" style="padding: 2px;">
97+
<div style="display: flex; flex-wrap: wrap; justify-content: flex-end; margin-top: 5px;">
98+
{{ range .Params.tags }}
99+
<a href="/tags/{{ . | urlize }}" style="margin-right: 5px;
100+
color: white;
101+
background-color: rgb(55, 162, 121);
102+
border-radius: 6px;
103+
padding: 1px 12px; ">
104+
{{ . }}
105+
</a>
106+
{{ end }}
107+
</div>
108+
</div>
109+
{{- end }}
110+
111+
</article>
112+
{{- end }}
113+
114+
{{- if gt $paginator.TotalPages 1 }}
115+
<footer class="page-footer">
116+
<nav class="pagination">
117+
{{- if $paginator.HasPrev }}
118+
<a class="prev" href="{{ $paginator.Prev.URL | absURL }}">
119+
«&nbsp;{{ i18n "prev_page" }}&nbsp;
120+
{{- if (.Param "ShowPageNums") }}
121+
{{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }}
122+
{{- end }}
123+
</a>
124+
{{- end }}
125+
{{- if $paginator.HasNext }}
126+
<a class="next" href="{{ $paginator.Next.URL | absURL }}">
127+
{{- i18n "next_page" }}&nbsp;
128+
{{- if (.Param "ShowPageNums") }}
129+
{{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }}
130+
{{- end }}&nbsp;»
131+
</a>
132+
{{- end }}
133+
</nav>
134+
</footer>
135+
{{- end }}
136+
137+
{{- end }}{{/* end profileMode */}}
138+
139+
{{- end }}{{- /* end main */ -}}

layouts/_default/single.html

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{{- define "main" }}
2+
3+
<article class="post-single">
4+
<header class="post-header">
5+
{{ partial "breadcrumbs.html" . }}
6+
<h1 class="post-title entry-hint-parent">
7+
{{ .Title }}
8+
{{- if .Draft }}
9+
<span class="entry-hint" title="Draft">
10+
<svg xmlns="http://www.w3.org/2000/svg" height="35" viewBox="0 -960 960 960" fill="currentColor">
11+
<path
12+
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
13+
</svg>
14+
</span>
15+
{{- end }}
16+
</h1>
17+
{{- if .Description }}
18+
<div class="post-description">
19+
{{ .Description }}
20+
</div>
21+
{{- end }}
22+
{{- if not (.Param "hideMeta") }}
23+
<div class="post-meta">
24+
{{- partial "post_meta.html" . -}}
25+
{{- partial "translation_list.html" . -}}
26+
{{- partial "edit_post.html" . -}}
27+
{{- partial "post_canonical.html" . -}}
28+
</div>
29+
{{- end }}
30+
31+
{{- /* Customization: Add tags */ -}}
32+
{{- if .Params.tags }}
33+
<div class="tags" style="padding: 2px;">
34+
<div style="display: flex; flex-wrap: wrap; justify-content: flex-end; margin-top: 5px;">
35+
{{ range .Params.tags }}
36+
<a href="/tags/{{ . | urlize }}" style="margin-right: 5px;
37+
color: white;
38+
background-color: rgb(55, 162, 121);
39+
border-radius: 6px;
40+
padding: 1px 12px; ">
41+
{{ . }}
42+
</a>
43+
{{ end }}
44+
</div>
45+
</div>
46+
{{- end }}
47+
48+
</header>
49+
{{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }}
50+
{{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }}
51+
{{- if (.Param "ShowToc") }}
52+
{{- partial "toc.html" . }}
53+
{{- end }}
54+
55+
{{- if .Content }}
56+
<div class="post-content">
57+
{{- if not (.Param "disableAnchoredHeadings") }}
58+
{{- partial "anchored_headings.html" .Content -}}
59+
{{- else }}{{ .Content }}{{ end }}
60+
</div>
61+
{{- end }}
62+
63+
<footer class="post-footer">
64+
{{- $tags := .Language.Params.Taxonomies.tag | default "tags" }}
65+
<ul class="post-tags">
66+
{{- range ($.GetTerms $tags) }}
67+
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
68+
{{- end }}
69+
</ul>
70+
{{- if (.Param "ShowPostNavLinks") }}
71+
{{- partial "post_nav_links.html" . }}
72+
{{- end }}
73+
{{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
74+
{{- partial "share_icons.html" . -}}
75+
{{- end }}
76+
</footer>
77+
78+
{{- if (.Param "comments") }}
79+
{{- partial "comments.html" . }}
80+
{{- end }}
81+
</article>
82+
83+
{{- end }}{{/* end main */}}

0 commit comments

Comments
 (0)