Skip to content

Commit d017562

Browse files
committed
Update post
1 parent 663428a commit d017562

23 files changed

Lines changed: 322 additions & 101 deletions

File tree

config.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ params:
8383
# home-info mode
8484
homeInfoParams:
8585
Title: "👋Welcome to Liqiang'Log"
86-
Content: Hi, this is Liqiang. I'm documenting my learning notes in this blog.
86+
Content: Hi, this is Liqiang. I'm documenting my thoughts this blog.
8787

8888
socialIcons:
8989
- name: x
@@ -94,10 +94,6 @@ params:
9494
analytics:
9595
google:
9696
SiteVerificationTag: "XYZabc"
97-
#bing:
98-
# SiteVerificationTag: "XYZabc"
99-
#yandex:
100-
# SiteVerificationTag: "XYZabc"
10197

10298
cover:
10399
hidden: true # hide everywhere but not in structured data
@@ -126,7 +122,7 @@ menu:
126122
name: Posts
127123
url: /posts/
128124
weight: 10
129-
- identifier: trchives
125+
- identifier: archives
130126
name: Archives
131127
url: /archives/
132128
weight: 20
@@ -138,10 +134,6 @@ menu:
138134
name: Search
139135
url: /search/
140136
weight: 40
141-
- identifier: emojisearch
142-
name: emojisearch.app
143-
url: https://www.emojisearch.app
144-
weight: 50
145137
# Read: https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#using-hugos-syntax-highlighter-chroma
146138
pygmentsUseClasses: true
147139
markup:

content/posts/first-post.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
2-
title: 'What I believe'
2+
title: 'About'
33
date: 2024-09-16T13:55:11+08:00
44
draft: false
55
weight: 1
66
---
7-
## The Things I Do
8-
There are countless activities one can pursue, but I focus on a select few that matter to me: reading books, working out, making money, and being kind to people—especially my family.
7+
# On Choosing What Matters
98

10-
## Try and Don't Give Up
11-
There's one guaranteed way to fail, and that's to stop trying!
9+
There are many things a person can do in a lifetime. I have learned that trying to do everything usually means doing nothing well.
10+
11+
So I choose a few things and return to them quietly: reading to understand the world, training my body to stay grounded in it, building financial stability to earn freedom over time, and treating people with care—especially those closest to me. These are not ambitious goals. They are sustainable ones.
12+
13+
Trying matters more than succeeding. Progress is uneven, and failure appears in different forms, often without warning. But there is one decision that guarantees the end of all movement forward: giving up.
14+
15+
As long as I continue, something remains possible.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<meta property="og:title" content="{{ .Title }}" />
2+
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
3+
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
4+
<meta property="og:url" content="{{ .Permalink }}" />
5+
{{- if .Params.cover.image -}}
6+
{{- if (ne .Params.cover.relative true) }}
7+
<meta property="og:image" content="{{ .Params.cover.image | absURL }}" />
8+
{{- else}}
9+
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
10+
{{- end}}
11+
{{- else }}
12+
13+
{{- $images := partial "templates/_funcs/get-page-images" . -}}
14+
{{- range first 6 $images }}
15+
<meta property="og:image" content="{{ .Permalink }}" />
16+
{{ end -}}
17+
{{- end }}
18+
19+
{{- if .IsPage }}
20+
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
21+
<meta property="article:section" content="{{ .Section }}" />
22+
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
23+
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
24+
{{- end -}}
25+
26+
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
27+
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
28+
{{- with site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
29+
{{- with .Params.videos }}{{- range . }}
30+
<meta property="og:video" content="{{ . | absURL }}" />
31+
{{ end }}{{ end }}
32+
33+
{{- /* If it is part of a series, link to related articles */}}
34+
{{- $permalink := .Permalink }}
35+
{{- $siteSeries := site.Taxonomies.series }}
36+
{{- if $siteSeries }}
37+
{{ with .Params.series }}{{- range $name := . }}
38+
{{- $series := index $siteSeries ($name | urlize) }}
39+
{{- range $page := first 6 $series.Pages }}
40+
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
41+
{{- end }}
42+
{{ end }}{{ end }}
43+
{{- end }}
44+
45+
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
46+
{{- $facebookAdmin := "" }}
47+
{{- with site.Params.social }}
48+
{{- if reflect.IsMap . }}
49+
{{- $facebookAdmin = .facebook_admin }}
50+
{{- end }}
51+
{{- end }}
52+
53+
{{- /* Facebook Page Admin ID for Domain Insights */}}
54+
{{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
55+
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{{ if .IsHome }}
2+
<script type="application/ld+json">
3+
{
4+
"@context": "https://schema.org",
5+
"@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}",
6+
"name": {{ site.Title }},
7+
"url": {{ site.Home.Permalink }},
8+
"description": {{ site.Params.description | plainify | truncate 180 | safeHTML }},
9+
"thumbnailUrl": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }},
10+
"sameAs": [
11+
{{- if site.Params.schema.sameAs }}
12+
{{ range $i, $e := site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }}
13+
{{- else}}
14+
{{ range $i, $e := site.Params.SocialIcons }}{{ if $i }}, {{ end }}{{ trim $e.url " " | safeURL }}{{ end }}
15+
{{- end}}
16+
]
17+
}
18+
</script>
19+
{{- else if (or .IsPage .IsSection) }}
20+
{{/* BreadcrumbList */}}
21+
{{- $url := replace .Parent.Permalink ( printf "%s" site.Home.Permalink) "" }}
22+
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
23+
{{- $bc_list := (split $lang_url "/")}}
24+
25+
{{- $scratch := newScratch }}
26+
<script type="application/ld+json">
27+
{
28+
"@context": "https://schema.org",
29+
"@type": "BreadcrumbList",
30+
"itemListElement": [
31+
{{- range $index, $element := $bc_list }}
32+
33+
{{- $scratch.Add "path" (printf "%s/" $element ) | safeJS }}
34+
{{- $bc_pg := site.GetPage ($scratch.Get "path") -}}
35+
36+
{{- if (and ($bc_pg) (gt (len . ) 0))}}
37+
{{- if (and $index)}}, {{end }}
38+
{
39+
"@type": "ListItem",
40+
"position": {{ add 1 $index }},
41+
"name": {{ $bc_pg.Name }},
42+
"item": {{ $bc_pg.Permalink | safeHTML }}
43+
}
44+
{{- end }}
45+
46+
{{- end }}
47+
{{- /* self-page addition */ -}}
48+
{{- if (ge (len $bc_list) 2) }}, {{end }}
49+
{
50+
"@type": "ListItem",
51+
"position": {{len $bc_list}},
52+
"name": {{ .Name }},
53+
"item": {{ .Permalink | safeHTML }}
54+
}
55+
]
56+
}
57+
</script>
58+
{{- if .IsPage }}
59+
<script type="application/ld+json">
60+
{
61+
"@context": "https://schema.org",
62+
"@type": "BlogPosting",
63+
"headline": {{ .Title | plainify}},
64+
"name": "{{ .Title | plainify }}",
65+
"description": {{ with .Description | plainify }}{{ . }}{{ else }}{{ .Summary | plainify }}{{ end -}},
66+
"keywords": [
67+
{{- if .Params.keywords }}
68+
{{ range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
69+
{{- else }}
70+
{{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
71+
{{- end }}
72+
],
73+
"articleBody": {{ .Content | safeJS | htmlUnescape | plainify }},
74+
"wordCount" : "{{ .WordCount }}",
75+
"inLanguage": {{ .Language.Lang | default "en-us" }},
76+
{{ if .Params.cover.image -}}
77+
"image":
78+
{{- if (ne .Params.cover.relative true) -}}
79+
{{ .Params.cover.image | absURL }},
80+
{{- else -}}
81+
{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }},
82+
{{- end}}
83+
{{- else }}
84+
{{- $images := partial "templates/_funcs/get-page-images" . -}}
85+
{{- with index $images 0 -}}
86+
"image": {{ .Permalink }},
87+
{{- end }}
88+
{{- end -}}
89+
"datePublished": {{ .PublishDate }},
90+
"dateModified": {{ .Lastmod }},
91+
{{- with (.Params.author | default site.Params.author) }}
92+
"author":
93+
{{- if (or (eq (printf "%T" .) "[]string") (eq (printf "%T" .) "[]interface {}")) -}}
94+
[{{- range $i, $v := . -}}
95+
{{- if $i }}, {{end -}}
96+
{
97+
"@type": "Person",
98+
"name": {{ $v }}
99+
}
100+
{{- end }}],
101+
{{- else -}}
102+
{
103+
"@type": "Person",
104+
"name": {{ . }}
105+
},
106+
{{- end -}}
107+
{{- end }}
108+
"mainEntityOfPage": {
109+
"@type": "WebPage",
110+
"@id": {{ .Permalink | safeHTML }}
111+
},
112+
"publisher": {
113+
"@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}",
114+
"name": {{ site.Title }},
115+
"logo": {
116+
"@type": "ImageObject",
117+
"url": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }}
118+
}
119+
}
120+
}
121+
</script>
122+
{{- end }}{{/* .IsPage end */}}
123+
124+
{{- end -}}
125+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- if .Params.cover.image -}}
2+
<meta name="twitter:card" content="summary_large_image" />
3+
{{- if (ne $.Params.cover.relative true) }}
4+
<meta name="twitter:image" content="{{ .Params.cover.image | absURL }}" />
5+
{{- else }}
6+
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
7+
{{- end}}
8+
{{- else }}
9+
{{- $images := partial "templates/_funcs/get-page-images" . -}}
10+
{{- with index $images 0 -}}
11+
<meta name="twitter:card" content="summary_large_image" />
12+
<meta name="twitter:image" content="{{ .Permalink }}" />
13+
{{- else -}}
14+
<meta name="twitter:card" content="summary"/>
15+
{{- end -}}
16+
{{- end }}
17+
<meta name="twitter:title" content="{{ .Title }}"/>
18+
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
19+
{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
20+
{{- $twitterSite := "" }}
21+
{{- with site.Params.social }}
22+
{{- if reflect.IsMap . }}
23+
{{- $twitterSite = .twitter }}
24+
{{- end }}
25+
{{- end }}
26+
27+
{{- with $twitterSite }}
28+
{{- $content := . }}
29+
{{- if not (strings.HasPrefix . "@") }}
30+
{{- $content = printf "@%v" $twitterSite }}
31+
{{- end }}
32+
<meta name="twitter:site" content="{{ $content }}"/>
33+
{{- end }}
34+

0 commit comments

Comments
 (0)