compile
This commit is contained in:
		| @@ -3,8 +3,9 @@ | |||||||
| baseURL: "https://blackwolf.drwater.net/" | baseURL: "https://blackwolf.drwater.net/" | ||||||
| languageCode: zh-cn | languageCode: zh-cn | ||||||
| title: Black Wolf | title: Black Wolf | ||||||
| paginate: 5 |  | ||||||
| theme: [hugo-PaperMod] | theme: [hugo-PaperMod] | ||||||
|  | pagination: | ||||||
|  |   pagerSize: 5 | ||||||
|  |  | ||||||
| enableInlineShortcodes: true | enableInlineShortcodes: true | ||||||
| enableRobotsTXT: true | enableRobotsTXT: true | ||||||
|   | |||||||
							
								
								
									
										27
									
								
								content/article/西天取经持恒心.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								content/article/西天取经持恒心.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | |||||||
|  | --- | ||||||
|  | title: 西天取经持恒心--读《西游记》有感 | ||||||
|  | author: Black Wolf | ||||||
|  | date: 2025-03-28 | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | 吴承恩所著的《西游记》是一部经典神魔小说,书中细致描绘了唐僧师徒四人西天取经的艰辛历程。他们一路历经九九八十一难,最终成功抵达灵山,取得真经。这看似是一场神话冒险,实则蕴含着深刻的人生哲理——做事要持之以恒。 | ||||||
|  |  | ||||||
|  | 师徒四人的取经路闪烁着持之以恒的光芒。孙悟空本领高强,降妖除魔时面对实力强劲的对手,多次陷入困境,但他从不言弃,始终坚守着护送唐僧的使命,凭借不懈的努力一次次化险为夷。唐僧作为团队的核心,心怀普度众生的宏愿,哪怕前方妖魔鬼怪横行,哪怕被误解、被威胁,他对取经的信念也从未动摇,一步一个脚印坚定地向西天前行。沙僧默默挑着重担,在漫长的旅途中,他以沉稳和坚毅,持之以恒地守护着团队。相比之下,猪八戒虽偶尔偷懒,甚至多次想打退堂鼓,但在同伴的影响和支持下,也坚持走到最后。他们的经历告诉我们,无论遇到什么样的困难,只要持之以恒,就能跨越重重障碍和磨难。 | ||||||
|  |  | ||||||
|  | 这不禁让我想起了铁杵磨针的故事。唐代大诗人李白,年少时并不爱读书。一次逃课玩耍,他在山下河边看到一位老婆婆在努力地磨着一根铁杵,好奇之下询问,才得知老婆婆是要把铁杵磨成针。李白惊讶于这看似不可能的目标,而老婆婆那句“只要天天磨,铁杵就能越磨越细,还怕磨不成针吗!”令李白深感惭愧,从此发愤读书,将“只要功夫深,铁杵磨成针”的道理铭记于心,最终成为流芳千古的“诗仙”。 | ||||||
|  |  | ||||||
|  | 反观现实中的我们,生活在一个物质条件极为便利的时代,想做的事情似乎触手可得,但奇怪的是,我们经常在困难面前轻易退缩!学骑自行车,刚摔了几次就心生恐惧,放弃练习;尝试滑旱冰,觉得难以掌握平衡,便迅速选择放弃;就连跑步这样简单的运动,也会因些许劳累就不愿坚持。最终,让宝贵的时间在犹豫和放弃中白白流逝。 | ||||||
|  |  | ||||||
|  | 做事如同取经,没有一条路是平坦的,唯有持之以恒,才能跨越重重阻碍,抵达成功的彼岸。让我们以师徒四人为榜样,在人生的道路上,无论遇到多少艰难险阻,都能坚守信念,持之以恒地朝着目标前进,用坚持和毅力书写属于自己的辉煌。 | ||||||
|  |  | ||||||
|  | 夜,静谧。柔和的月光洒下一地银辉。微风带来凉爽的夜气,也带来鸣虫演奏的小夜曲。我趴在窗前,思绪不禁飘回了那个让我真正长大的瞬间。 | ||||||
|  |  | ||||||
|  | 以前,我吃饭总是毛毛躁躁,桌上和地上常常掉满饭粒,而且每次都会剩一些。爸爸虽看在眼里,却一直没有多说。 | ||||||
|  |  | ||||||
|  | 那天,我又慢吞吞地吃着米饭,像往常一样,才吃了一半多一点,就把碗一推,准备倒掉去看电视。这时,爸爸突然叫住我,温和地说:“你知道奶奶小时候过的是什么样的日子吗?”我一下子来了好奇心,放下碗筷,抬起头看向爸爸。只见他的眼神里满是耐心与温和,他拉过椅子,在我身旁缓缓坐下,微微眯起眼睛,仿佛陷入了回忆:“奶奶出生在1964年,大饥荒刚结束不久,那时家里一点粮食都没有,太爷爷太奶奶只能带着一家人去外面找野菜。在那场饥荒中,百姓生活困苦不堪。他们吃完家中的牲畜,便开始啃食树皮、野菜,甚至吃土充饥。很多人被迫卖儿卖女,沿路饿殍满地,惨状令人触目惊心。这也是为什么奶奶直到今天,一点粮食都不想浪费的原因。”爸爸说着,轻轻叹了口气,眼中流露出一丝沉痛。 | ||||||
|  |  | ||||||
|  | 在这一刻,眼泪顺着我的脸颊滑了下来,一种深刻的内疚与震撼交织在一起,涌进我身体里的每一根血管。我对过去浪费食物的行为感到强烈的羞愧! | ||||||
|  |  | ||||||
|  | 在这一瞬间,我感到我的内心发生了变化,我知道我真的长大了。我看着碗里剩下的米饭,仿佛看到了饥荒岁月里人们对食物的渴望眼神。我深吸一口气,拿起筷子,一口一口认真地吃起来,每一口都嚼得格外仔细,不再像以前一样狼吞虎咽,也不再嫌弃饭没有味道。那些原本准备倒掉的米饭,此刻在我眼中变得格外珍贵。吃完后,我又小心地把桌上掉的饭粒一颗颗捡起。看着干干净净的碗和桌面,我心里有一种前所未有的踏实感。 | ||||||
|  |  | ||||||
|  | 从那以后,我时刻铭记爸爸的话,珍惜每一粒粮食,积极践行“光盘行动”,因为我知道,每一份食物都来之不易,背后都承载着过去的苦难与记忆。 | ||||||
							
								
								
									
										17
									
								
								content/article/那一刻我长大了.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								content/article/那一刻我长大了.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  | --- | ||||||
|  | title: 那一刻,我长大了 | ||||||
|  | author: Black Wolf | ||||||
|  | date: 2025-02-28 | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | 夜,静谧。柔和的月光洒下一地银辉。微风带来凉爽的夜气,也带来鸣虫演奏的小夜曲。我趴在窗前,思绪不禁飘回了那个让我真正长大的瞬间。 | ||||||
|  |  | ||||||
|  | 以前,我吃饭总是毛毛躁躁,桌上和地上常常掉满饭粒,而且每次都会剩一些。爸爸虽看在眼里,却一直没有多说。 | ||||||
|  |  | ||||||
|  | 那天,我又慢吞吞地吃着米饭,像往常一样,才吃了一半多一点,就把碗一推,准备倒掉去看电视。这时,爸爸突然叫住我,温和地说:“你知道奶奶小时候过的是什么样的日子吗?”我一下子来了好奇心,放下碗筷,抬起头看向爸爸。只见他的眼神里满是耐心与温和,他拉过椅子,在我身旁缓缓坐下,微微眯起眼睛,仿佛陷入了回忆:“奶奶出生在1964年,大饥荒刚结束不久,那时家里一点粮食都没有,太爷爷太奶奶只能带着一家人去外面找野菜。在那场饥荒中,百姓生活困苦不堪。他们吃完家中的牲畜,便开始啃食树皮、野菜,甚至吃土充饥。很多人被迫卖儿卖女,沿路饿殍满地,惨状令人触目惊心。这也是为什么奶奶直到今天,一点粮食都不想浪费的原因。”爸爸说着,轻轻叹了口气,眼中流露出一丝沉痛。 | ||||||
|  |  | ||||||
|  | 在这一刻,眼泪顺着我的脸颊滑了下来,一种深刻的内疚与震撼交织在一起,涌进我身体里的每一根血管。我对过去浪费食物的行为感到强烈的羞愧! | ||||||
|  |  | ||||||
|  | 在这一瞬间,我感到我的内心发生了变化,我知道我真的长大了。我看着碗里剩下的米饭,仿佛看到了饥荒岁月里人们对食物的渴望眼神。我深吸一口气,拿起筷子,一口一口认真地吃起来,每一口都嚼得格外仔细,不再像以前一样狼吞虎咽,也不再嫌弃饭没有味道。那些原本准备倒掉的米饭,此刻在我眼中变得格外珍贵。吃完后,我又小心地把桌上掉的饭粒一颗颗捡起。看着干干净净的碗和桌面,我心里有一种前所未有的踏实感。 | ||||||
|  |  | ||||||
|  | 从那以后,我时刻铭记爸爸的话,珍惜每一粒粮食,积极践行“光盘行动”,因为我知道,每一份食物都来之不易,背后都承载着过去的苦难与记忆。 | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| title: KET words | title: KET words | ||||||
| date: last-modifed | date: '2025-02-07' | ||||||
| --- | --- | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| title: KET words | title: KET words | ||||||
| date: last-modifed | date: "2025-02-07" | ||||||
| --- | --- | ||||||
|  |  | ||||||
| # Common words | # Common words | ||||||
|   | |||||||
| @@ -1,9 +1,8 @@ | |||||||
| --- | --- | ||||||
| title: KET集训1 | title: KET集训1 | ||||||
| date: 2024-1-11 | date: 2024-01-11 | ||||||
| --- | --- | ||||||
|  |  | ||||||
|  |  | ||||||
| # Part 1 | # Part 1 | ||||||
|  |  | ||||||
| ## Step 1 | ## Step 1 | ||||||
|   | |||||||
| @@ -1,11 +1,10 @@ | |||||||
| --- | --- | ||||||
| title: 不规则动词的时态 | title: 不规则动词的时态 | ||||||
| date: 2024-1-8 | date: 2024-01-08 | ||||||
| --- | --- | ||||||
|  |  | ||||||
|  |  | ||||||
| | 基本形式       | 过去式   | 过去分词  | | | 基本形式       | 过去式   | 过去分词  | | ||||||
| |---------------|-------------|--------------| | | -------------- | -------- | --------- | | ||||||
| | be (是)        | was/were | been      | | | be (是)        | was/were | been      | | ||||||
| | have (有)      | had      | had       | | | have (有)      | had      | had       | | ||||||
| | do (做)        | did      | done      | | | do (做)        | did      | done      | | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								layouts/layouts/404.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								layouts/layouts/404.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | {{- define "main" }} | ||||||
|  | <div class="not-found">404</div> | ||||||
|  | {{- end }}{{/* end main */ -}} | ||||||
							
								
								
									
										22
									
								
								layouts/layouts/_default/_markup/render-image.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								layouts/layouts/_default/_markup/render-image.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | |||||||
|  | {{- $u := urls.Parse .Destination -}} | ||||||
|  | {{- $src := $u.String -}} | ||||||
|  | {{- if not $u.IsAbs -}} | ||||||
|  |   {{- $path := strings.TrimPrefix "./" $u.Path }} | ||||||
|  |   {{- with or (.PageInner.Resources.Get $path) (resources.Get $path) -}} | ||||||
|  |     {{- $src = .RelPermalink -}} | ||||||
|  |     {{- with $u.RawQuery -}} | ||||||
|  |       {{- $src = printf "%s?%s" $src . -}} | ||||||
|  |     {{- end -}} | ||||||
|  |     {{- with $u.Fragment -}} | ||||||
|  |       {{- $src = printf "%s#%s" $src . -}} | ||||||
|  |     {{- end -}} | ||||||
|  |   {{- end -}} | ||||||
|  | {{- end -}} | ||||||
|  | {{- $attributes := merge .Attributes (dict "alt" .Text "src" $src "title" (.Title | transform.HTMLEscape) "loading" "lazy") -}} | ||||||
|  | <img | ||||||
|  |   {{- range $k, $v := $attributes -}} | ||||||
|  |     {{- if $v -}} | ||||||
|  |       {{- printf " %s=%q" $k $v | safeHTMLAttr -}} | ||||||
|  |     {{- end -}} | ||||||
|  |   {{- end -}}> | ||||||
|  | {{- /**/ -}} | ||||||
							
								
								
									
										83
									
								
								layouts/layouts/_default/archives.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								layouts/layouts/_default/archives.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,83 @@ | |||||||
|  | {{- define "main" }} | ||||||
|  |  | ||||||
|  | <header class="page-header"> | ||||||
|  |   <h1> | ||||||
|  |     {{ .Title }} | ||||||
|  |     {{- if (.Param "ShowRssButtonInSectionTermList") }} | ||||||
|  |     {{- $rss := (.OutputFormats.Get "rss") }} | ||||||
|  |     {{- if (eq .Kind `page`) }} | ||||||
|  |     {{- $rss = (.Parent.OutputFormats.Get "rss") }} | ||||||
|  |     {{- end }} | ||||||
|  |     {{- with $rss }} | ||||||
|  |     <a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS"> | ||||||
|  |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" | ||||||
|  |         stroke-linecap="round" stroke-linejoin="round" height="23"> | ||||||
|  |         <path d="M4 11a9 9 0 0 1 9 9" /> | ||||||
|  |         <path d="M4 4a16 16 0 0 1 16 16" /> | ||||||
|  |         <circle cx="5" cy="19" r="1" /> | ||||||
|  |       </svg> | ||||||
|  |     </a> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- end }} | ||||||
|  |   </h1> | ||||||
|  |   {{- if .Description }} | ||||||
|  |   <div class="post-description"> | ||||||
|  |     {{ .Description }} | ||||||
|  |   </div> | ||||||
|  |   {{- end }} | ||||||
|  | </header> | ||||||
|  |  | ||||||
|  | {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} | ||||||
|  |  | ||||||
|  | {{- if site.Params.ShowAllPagesInArchive }} | ||||||
|  | {{- $pages = site.RegularPages }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- range $pages.GroupByPublishDate "2006" }} | ||||||
|  | {{- if ne .Key "0001" }} | ||||||
|  | <div class="archive-year"> | ||||||
|  |   {{- $year := replace .Key "0001" "" }} | ||||||
|  |   <h2 class="archive-year-header" id="{{ $year }}"> | ||||||
|  |     <a class="archive-header-link" href="#{{ $year }}"> | ||||||
|  |       {{- $year -}} | ||||||
|  |     </a> | ||||||
|  |     <sup class="archive-count"> {{ len .Pages }}</sup> | ||||||
|  |   </h2> | ||||||
|  |   {{- range .Pages.GroupByDate "January" }} | ||||||
|  |   <div class="archive-month"> | ||||||
|  |     <h3 class="archive-month-header" id="{{ $year }}-{{ .Key }}"> | ||||||
|  |       <a class="archive-header-link" href="#{{ $year }}-{{ .Key }}"> | ||||||
|  |         {{- .Key -}} | ||||||
|  |       </a> | ||||||
|  |       <sup class="archive-count"> {{ len .Pages }}</sup> | ||||||
|  |     </h3> | ||||||
|  |     <div class="archive-posts"> | ||||||
|  |       {{- range .Pages }} | ||||||
|  |       {{- if eq .Kind "page" }} | ||||||
|  |       <div class="archive-entry"> | ||||||
|  |         <h3 class="archive-entry-title entry-hint-parent"> | ||||||
|  |           {{- .Title | markdownify }} | ||||||
|  |           {{- if .Draft }} | ||||||
|  |           <span class="entry-hint" title="Draft"> | ||||||
|  |             <svg xmlns="http://www.w3.org/2000/svg" height="15" viewBox="0 -960 960 960" fill="currentColor"> | ||||||
|  |               <path | ||||||
|  |                 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" /> | ||||||
|  |             </svg> | ||||||
|  |           </span> | ||||||
|  |           {{- end }} | ||||||
|  |         </h3> | ||||||
|  |         <div class="archive-meta"> | ||||||
|  |           {{- partial "post_meta.html" . -}} | ||||||
|  |         </div> | ||||||
|  |         <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> | ||||||
|  |       </div> | ||||||
|  |       {{- end }} | ||||||
|  |       {{- end }} | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  |   {{- end }} | ||||||
|  | </div> | ||||||
|  | {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- end }}{{/* end main */}} | ||||||
							
								
								
									
										27
									
								
								layouts/layouts/_default/baseof.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								layouts/layouts/_default/baseof.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | |||||||
|  | {{- if lt hugo.Version "0.146.0" }} | ||||||
|  | {{- errorf "=> hugo v0.146.0 or greater is required for hugo-PaperMod to build " }} | ||||||
|  | {{- end -}} | ||||||
|  |  | ||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="{{ site.Language }}" dir="{{ .Language.LanguageDirection | default "auto" }}"> | ||||||
|  |  | ||||||
|  | <head> | ||||||
|  |     {{- partial "head.html" . }} | ||||||
|  | </head> | ||||||
|  |  | ||||||
|  | <body class=" | ||||||
|  | {{- if (or (ne .Kind `page` ) (eq .Layout `archives`) (eq .Layout `search`)) -}} | ||||||
|  | {{- print "list" -}} | ||||||
|  | {{- end -}} | ||||||
|  | {{- if eq site.Params.defaultTheme `dark` -}} | ||||||
|  | {{- print " dark" }} | ||||||
|  | {{- end -}} | ||||||
|  | " id="top"> | ||||||
|  |     {{- partialCached "header.html" . .Page -}} | ||||||
|  |     <main class="main"> | ||||||
|  |         {{- block "main" . }}{{ end }} | ||||||
|  |     </main> | ||||||
|  |     {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} | ||||||
|  | </body> | ||||||
|  |  | ||||||
|  | </html> | ||||||
							
								
								
									
										7
									
								
								layouts/layouts/_default/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								layouts/layouts/_default/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | {{- $.Scratch.Add "index" slice -}} | ||||||
|  | {{- range site.RegularPages -}} | ||||||
|  |     {{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }} | ||||||
|  |     {{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}} | ||||||
|  |     {{- end }} | ||||||
|  | {{- end -}} | ||||||
|  | {{- $.Scratch.Get "index" | jsonify -}} | ||||||
							
								
								
									
										121
									
								
								layouts/layouts/_default/list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								layouts/layouts/_default/list.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,121 @@ | |||||||
|  | {{- define "main" }} | ||||||
|  |  | ||||||
|  | {{- if (and site.Params.profileMode.enabled .IsHome) }} | ||||||
|  | {{- partial "index_profile.html" . }} | ||||||
|  | {{- else }} {{/* if not profileMode */}} | ||||||
|  |  | ||||||
|  | {{- if not .IsHome | and .Title }} | ||||||
|  | <header class="page-header"> | ||||||
|  |   {{- partial "breadcrumbs.html" . }} | ||||||
|  |   <h1> | ||||||
|  |     {{ .Title }} | ||||||
|  |     {{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }} | ||||||
|  |     {{- with .OutputFormats.Get "rss" }} | ||||||
|  |     <a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS"> | ||||||
|  |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" | ||||||
|  |         stroke-linecap="round" stroke-linejoin="round" height="23"> | ||||||
|  |         <path d="M4 11a9 9 0 0 1 9 9" /> | ||||||
|  |         <path d="M4 4a16 16 0 0 1 16 16" /> | ||||||
|  |         <circle cx="5" cy="19" r="1" /> | ||||||
|  |       </svg> | ||||||
|  |     </a> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- end }} | ||||||
|  |   </h1> | ||||||
|  |   {{- if .Description }} | ||||||
|  |   <div class="post-description"> | ||||||
|  |     {{ .Description | markdownify }} | ||||||
|  |   </div> | ||||||
|  |   {{- end }} | ||||||
|  | </header> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if .Content }} | ||||||
|  | <div class="post-content"> | ||||||
|  |   {{- if not (.Param "disableAnchoredHeadings") }} | ||||||
|  |   {{- partial "anchored_headings.html" .Content -}} | ||||||
|  |   {{- else }}{{ .Content }}{{ end }} | ||||||
|  | </div> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- $pages := union .RegularPages .Sections }} | ||||||
|  |  | ||||||
|  | {{- if .IsHome }} | ||||||
|  | {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} | ||||||
|  | {{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true"  }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- $paginator := .Paginate $pages }} | ||||||
|  |  | ||||||
|  | {{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} | ||||||
|  | {{- partial "home_info.html" . }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- $term := .Data.Term }} | ||||||
|  | {{- range $index, $page := $paginator.Pages }} | ||||||
|  |  | ||||||
|  | {{- $class := "post-entry" }} | ||||||
|  |  | ||||||
|  | {{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} | ||||||
|  | {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} | ||||||
|  | {{- $class = "first-entry" }} | ||||||
|  | {{- else if $term }} | ||||||
|  | {{- $class = "post-entry tag-entry" }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | <article class="{{ $class }}"> | ||||||
|  |   {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} | ||||||
|  |   {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }} | ||||||
|  |   <header class="entry-header"> | ||||||
|  |     <h2 class="entry-hint-parent"> | ||||||
|  |       {{- .Title }} | ||||||
|  |       {{- if .Draft }} | ||||||
|  |       <span class="entry-hint" title="Draft"> | ||||||
|  |         <svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentColor"> | ||||||
|  |           <path | ||||||
|  |             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" /> | ||||||
|  |         </svg> | ||||||
|  |       </span> | ||||||
|  |       {{- end }} | ||||||
|  |     </h2> | ||||||
|  |   </header> | ||||||
|  |   {{- if (ne (.Param "hideSummary") true) }} | ||||||
|  |   <div class="entry-content"> | ||||||
|  |     <p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p> | ||||||
|  |   </div> | ||||||
|  |   {{- end }} | ||||||
|  |   {{- if not (.Param "hideMeta") }} | ||||||
|  |   <footer class="entry-footer"> | ||||||
|  |     {{- partial "post_meta.html" . -}} | ||||||
|  |   </footer> | ||||||
|  |   {{- end }} | ||||||
|  |   <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> | ||||||
|  | </article> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if gt $paginator.TotalPages 1 }} | ||||||
|  | <footer class="page-footer"> | ||||||
|  |   <nav class="pagination"> | ||||||
|  |     {{- if $paginator.HasPrev }} | ||||||
|  |     <a class="prev" href="{{ $paginator.Prev.URL | absURL }}"> | ||||||
|  |       « {{ i18n "prev_page" }}  | ||||||
|  |       {{- if (.Param "ShowPageNums") }} | ||||||
|  |       {{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }} | ||||||
|  |       {{- end }} | ||||||
|  |     </a> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if $paginator.HasNext }} | ||||||
|  |     <a class="next" href="{{ $paginator.Next.URL | absURL }}"> | ||||||
|  |       {{- i18n "next_page" }}  | ||||||
|  |       {{- if (.Param "ShowPageNums") }} | ||||||
|  |       {{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }} | ||||||
|  |       {{- end }} » | ||||||
|  |     </a> | ||||||
|  |     {{- end }} | ||||||
|  |   </nav> | ||||||
|  | </footer> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- end }}{{/* end profileMode */}} | ||||||
|  |  | ||||||
|  | {{- end }}{{- /* end main */ -}} | ||||||
							
								
								
									
										83
									
								
								layouts/layouts/_default/rss.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								layouts/layouts/_default/rss.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,83 @@ | |||||||
|  | {{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} | ||||||
|  | {{- $authorEmail := "" }} | ||||||
|  | {{- with site.Params.author }} | ||||||
|  |   {{- if reflect.IsMap . }} | ||||||
|  |     {{- with .email }} | ||||||
|  |       {{- $authorEmail = . }} | ||||||
|  |     {{- end }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- else }} | ||||||
|  |   {{- with site.Author.email }} | ||||||
|  |     {{- $authorEmail = . }} | ||||||
|  |     {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} | ||||||
|  | {{- $authorName := "" }} | ||||||
|  | {{- with site.Params.author }} | ||||||
|  |   {{- if reflect.IsMap . }} | ||||||
|  |     {{- with .name }} | ||||||
|  |       {{- $authorName = . }} | ||||||
|  |     {{- end }} | ||||||
|  |   {{- else }} | ||||||
|  |     {{- $authorName  = . }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- else }} | ||||||
|  |   {{- with site.Author.name }} | ||||||
|  |     {{- $authorName = . }} | ||||||
|  |     {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- $pctx := . }} | ||||||
|  | {{- if .IsHome }}{{ $pctx = site }}{{ end }} | ||||||
|  | {{- $pages := slice }} | ||||||
|  | {{- if or $.IsHome $.IsSection }} | ||||||
|  | {{- $pages = $pctx.RegularPages }} | ||||||
|  | {{- else }} | ||||||
|  | {{- $pages = $pctx.Pages }} | ||||||
|  | {{- end }} | ||||||
|  | {{- $limit := site.Config.Services.RSS.Limit }} | ||||||
|  | {{- if ge $limit 1 }} | ||||||
|  | {{- $pages = $pages | first $limit }} | ||||||
|  | {{- end }} | ||||||
|  | {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} | ||||||
|  | <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"> | ||||||
|  |   <channel> | ||||||
|  |     <title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }}</title> | ||||||
|  |     <link>{{ .Permalink }}</link> | ||||||
|  |     <description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }}</description> | ||||||
|  |     {{- with site.Params.images }} | ||||||
|  |     <image> | ||||||
|  |       <title>{{ site.Title }}</title> | ||||||
|  |       <url>{{ index . 0 | absURL }}</url> | ||||||
|  |       <link>{{ index . 0 | absURL }}</link> | ||||||
|  |     </image> | ||||||
|  |     {{- end }} | ||||||
|  |     <generator>Hugo -- {{ hugo.Version }}</generator> | ||||||
|  |     <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }} | ||||||
|  |     <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }} | ||||||
|  |     <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with site.Copyright }} | ||||||
|  |     <copyright>{{ . | markdownify | plainify | strings.TrimPrefix "© " }}</copyright>{{ end }}{{ if not .Date.IsZero }} | ||||||
|  |     <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} | ||||||
|  |     {{- with .OutputFormats.Get "RSS" }} | ||||||
|  |     {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} | ||||||
|  |     {{- end }} | ||||||
|  |     {{- range $pages }} | ||||||
|  |     {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} | ||||||
|  |     <item> | ||||||
|  |       <title>{{ .Title }}</title> | ||||||
|  |       <link>{{ .Permalink }}</link> | ||||||
|  |       <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> | ||||||
|  |       {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }} | ||||||
|  |       <guid>{{ .Permalink }}</guid> | ||||||
|  |       <description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description> | ||||||
|  |       {{- if and site.Params.ShowFullTextinRSS .Content }} | ||||||
|  |       <content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded> | ||||||
|  |       {{- end }} | ||||||
|  |     </item> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- end }} | ||||||
|  |   </channel> | ||||||
|  | </rss> | ||||||
							
								
								
									
										29
									
								
								layouts/layouts/_default/search.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								layouts/layouts/_default/search.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | {{- define "main" }} | ||||||
|  |  | ||||||
|  | <header class="page-header"> | ||||||
|  |     <h1>{{- (printf "%s " .Title ) | htmlUnescape -}} | ||||||
|  |         <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" | ||||||
|  |             stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> | ||||||
|  |             <circle cx="11" cy="11" r="8"></circle> | ||||||
|  |             <line x1="21" y1="21" x2="16.65" y2="16.65"></line> | ||||||
|  |         </svg> | ||||||
|  |     </h1> | ||||||
|  |     {{- if .Description }} | ||||||
|  |     <div class="post-description"> | ||||||
|  |         {{ .Description }} | ||||||
|  |     </div> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if not (.Param "hideMeta") }} | ||||||
|  |     <div class="post-meta"> | ||||||
|  |         {{- partial "translation_list.html" . -}} | ||||||
|  |     </div> | ||||||
|  |     {{- end }} | ||||||
|  | </header> | ||||||
|  |  | ||||||
|  | <div id="searchbox"> | ||||||
|  |     <input id="searchInput" autofocus placeholder="{{ .Params.placeholder | default (printf "%s ↵" .Title) }}" | ||||||
|  |         aria-label="search" type="search" autocomplete="off" maxlength="64"> | ||||||
|  |     <ul id="searchResults" aria-label="search results"></ul> | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  | {{- end }}{{/* end main */}} | ||||||
							
								
								
									
										65
									
								
								layouts/layouts/_default/single.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								layouts/layouts/_default/single.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | {{- define "main" }} | ||||||
|  |  | ||||||
|  | <article class="post-single"> | ||||||
|  |   <header class="post-header"> | ||||||
|  |     {{ partial "breadcrumbs.html" . }} | ||||||
|  |     <h1 class="post-title entry-hint-parent"> | ||||||
|  |       {{ .Title }} | ||||||
|  |       {{- if .Draft }} | ||||||
|  |       <span class="entry-hint" title="Draft"> | ||||||
|  |         <svg xmlns="http://www.w3.org/2000/svg" height="35" viewBox="0 -960 960 960" fill="currentColor"> | ||||||
|  |           <path | ||||||
|  |             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" /> | ||||||
|  |         </svg> | ||||||
|  |       </span> | ||||||
|  |       {{- end }} | ||||||
|  |     </h1> | ||||||
|  |     {{- if .Description }} | ||||||
|  |     <div class="post-description"> | ||||||
|  |       {{ .Description }} | ||||||
|  |     </div> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if not (.Param "hideMeta") }} | ||||||
|  |     <div class="post-meta"> | ||||||
|  |       {{- partial "post_meta.html" . -}} | ||||||
|  |       {{- partial "translation_list.html" . -}} | ||||||
|  |       {{- partial "edit_post.html" . -}} | ||||||
|  |       {{- partial "post_canonical.html" . -}} | ||||||
|  |     </div> | ||||||
|  |     {{- end }} | ||||||
|  |   </header> | ||||||
|  |   {{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }} | ||||||
|  |   {{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }} | ||||||
|  |   {{- if (.Param "ShowToc") }} | ||||||
|  |   {{- partial "toc.html" . }} | ||||||
|  |   {{- end }} | ||||||
|  |  | ||||||
|  |   {{- if .Content }} | ||||||
|  |   <div class="post-content"> | ||||||
|  |     {{- if not (.Param "disableAnchoredHeadings") }} | ||||||
|  |     {{- partial "anchored_headings.html" .Content -}} | ||||||
|  |     {{- else }}{{ .Content }}{{ end }} | ||||||
|  |   </div> | ||||||
|  |   {{- end }} | ||||||
|  |  | ||||||
|  |   <footer class="post-footer"> | ||||||
|  |     {{- $tags := .Language.Params.Taxonomies.tag | default "tags" }} | ||||||
|  |     <ul class="post-tags"> | ||||||
|  |       {{- range ($.GetTerms $tags) }} | ||||||
|  |       <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li> | ||||||
|  |       {{- end }} | ||||||
|  |     </ul> | ||||||
|  |     {{- if (.Param "ShowPostNavLinks") }} | ||||||
|  |     {{- partial "post_nav_links.html" . }} | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }} | ||||||
|  |     {{- partial "share_icons.html" . -}} | ||||||
|  |     {{- end }} | ||||||
|  |   </footer> | ||||||
|  |  | ||||||
|  |   {{- if (.Param "comments") }} | ||||||
|  |   {{- partial "comments.html" . }} | ||||||
|  |   {{- end }} | ||||||
|  | </article> | ||||||
|  |  | ||||||
|  | {{- end }}{{/* end main */}} | ||||||
							
								
								
									
										27
									
								
								layouts/layouts/_default/terms.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								layouts/layouts/_default/terms.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | |||||||
|  | {{- define "main" }} | ||||||
|  |  | ||||||
|  | {{- if .Title }} | ||||||
|  | <header class="page-header"> | ||||||
|  |     <h1>{{ .Title }}</h1> | ||||||
|  |     {{- if .Description }} | ||||||
|  |     <div class="post-description"> | ||||||
|  |         {{ .Description }} | ||||||
|  |     </div> | ||||||
|  |     {{- end }} | ||||||
|  | </header> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | <ul class="terms-tags"> | ||||||
|  |     {{- $type := .Type }} | ||||||
|  |     {{- range $key, $value := .Data.Terms.Alphabetical }} | ||||||
|  |     {{- $name := .Name }} | ||||||
|  |     {{- $count := .Count }} | ||||||
|  |     {{- with site.GetPage (printf "/%s/%s" $type $name) }} | ||||||
|  |     <li> | ||||||
|  |         <a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- end }} | ||||||
|  | </ul> | ||||||
|  |  | ||||||
|  | {{- end }}{{/* end main */ -}} | ||||||
							
								
								
									
										2
									
								
								layouts/layouts/partials/anchored_headings.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								layouts/layouts/partials/anchored_headings.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | |||||||
|  | {{- /* formats .Content headings by adding an anchor */ -}} | ||||||
|  | {{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}" | safeHTML }} | ||||||
							
								
								
									
										9
									
								
								layouts/layouts/partials/author.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								layouts/layouts/partials/author.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | {{- if or .Params.author site.Params.author }} | ||||||
|  | {{- $author := (.Params.author | default site.Params.author) }} | ||||||
|  | {{- $author_type := (printf "%T" $author) }} | ||||||
|  | {{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }} | ||||||
|  | {{- (delimit $author ", " ) }} | ||||||
|  | {{- else }} | ||||||
|  | {{- $author }} | ||||||
|  | {{- end }} | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										19
									
								
								layouts/layouts/partials/breadcrumbs.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								layouts/layouts/partials/breadcrumbs.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | {{- if (.Param "ShowBreadCrumbs") -}} | ||||||
|  | <div class="breadcrumbs"> | ||||||
|  |     {{- $url := replace .Parent.Permalink (printf "%s" site.Home.Permalink) "" }} | ||||||
|  |     {{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}} | ||||||
|  |  | ||||||
|  |     <a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home" }}</a> | ||||||
|  |     {{- $scratch := newScratch }} | ||||||
|  |     {{- range $index, $element := split $lang_url "/" }} | ||||||
|  |  | ||||||
|  |     {{- $scratch.Add "path" (printf "%s/" $element )}} | ||||||
|  |     {{- $bc_pg := site.GetPage ($scratch.Get "path") -}} | ||||||
|  |  | ||||||
|  |     {{- if (and ($bc_pg) (gt (len . ) 0))}} | ||||||
|  |     {{- print " » " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a> | ||||||
|  |     {{- end }} | ||||||
|  |  | ||||||
|  |     {{- end -}} | ||||||
|  | </div> | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										3
									
								
								layouts/layouts/partials/comments.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								layouts/layouts/partials/comments.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | {{- /* Comments area start */ -}} | ||||||
|  | {{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}} | ||||||
|  | {{- /* Comments area end */ -}} | ||||||
							
								
								
									
										65
									
								
								layouts/layouts/partials/cover.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								layouts/layouts/partials/cover.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | {{- with .cxt}} {{/* Apply proper context from dict */}} | ||||||
|  | {{- if (and .Params.cover.image (not $.isHidden)) }} | ||||||
|  | <figure class="entry-cover"> | ||||||
|  |     {{- $loading := cond $.IsSingle "eager" "lazy" }} | ||||||
|  |     {{- $addLink := (and site.Params.cover.linkFullImages $.IsSingle) }} | ||||||
|  |     {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} | ||||||
|  |     {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} | ||||||
|  |     {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} | ||||||
|  |  | ||||||
|  |     {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} | ||||||
|  |     {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} | ||||||
|  |     {{- $cover := (or $pageBundleCover $globalResourcesCover)}} | ||||||
|  |     {{- /* We are not using the .Param.cover.relative to decide the location of image */}} | ||||||
|  |     {{- /* If we have the image in pageBundle or globalResources we can process the image */}} | ||||||
|  |  | ||||||
|  |     {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} | ||||||
|  |     {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} | ||||||
|  |     {{- if hugo.IsExtended -}} | ||||||
|  |         {{- $processableFormats = $processableFormats | append "webp" -}} | ||||||
|  |     {{- end -}} | ||||||
|  |  | ||||||
|  |     {{- $imgdl := (.Params.cover.image) | absURL }} | ||||||
|  |     {{- if $cover -}} | ||||||
|  |         {{- $imgdl = $cover.Permalink }} | ||||||
|  |     {{- end -}} | ||||||
|  |  | ||||||
|  |     {{- if $addLink }} | ||||||
|  |         <a href="{{ $imgdl }}" target="_blank" rel="noopener noreferrer"> | ||||||
|  |     {{- end }} | ||||||
|  |  | ||||||
|  |     {{- if $cover -}} | ||||||
|  |         {{/* i.e it is present in page bundle */}} | ||||||
|  |         {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} | ||||||
|  |             <img loading="{{$loading}}" | ||||||
|  |                 srcset='{{- range $size := $sizes -}} | ||||||
|  |                             {{- if (ge $cover.Width $size) }} | ||||||
|  |                                 {{- printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw," $size) }} | ||||||
|  |                             {{- end }} | ||||||
|  |                         {{- end }} | ||||||
|  |                         {{- printf "%s %dw" ($cover.Permalink) ($cover.Width) }}' | ||||||
|  |                 src="{{ $cover.Permalink }}" | ||||||
|  |                 sizes="(min-width: 768px) 720px, 100vw" | ||||||
|  |                 width="{{ $cover.Width }}" height="{{ $cover.Height }}" | ||||||
|  |                 alt="{{ $alt }}"> | ||||||
|  |         {{- else }}{{/* Unprocessable image or responsive images disabled */}} | ||||||
|  |             <img loading="{{ $loading }}" src="{{ $imgdl }}" alt="{{ $alt }}"> | ||||||
|  |         {{- end }} | ||||||
|  |     {{- else }} | ||||||
|  |         {{- /* For absolute urls and external links, no img processing here */}} | ||||||
|  |         <img loading="{{ $loading }}" src="{{ $imgdl }}" alt="{{ $alt }}"> | ||||||
|  |     {{- end }} | ||||||
|  |  | ||||||
|  |     {{- if $addLink }} | ||||||
|  |         </a> | ||||||
|  |     {{- end -}} | ||||||
|  |  | ||||||
|  |     {{- /*  Display Caption  */}} | ||||||
|  |     {{- if $.IsSingle }} | ||||||
|  |         {{ with .Params.cover.caption -}} | ||||||
|  |             <figcaption>{{ . | markdownify }}</figcaption> | ||||||
|  |         {{- end }} | ||||||
|  |     {{- end }} | ||||||
|  | </figure> | ||||||
|  | {{- end }}{{/* End image */}} | ||||||
|  | {{- end -}}{{/* End context */ -}} | ||||||
							
								
								
									
										8
									
								
								layouts/layouts/partials/edit_post.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								layouts/layouts/partials/edit_post.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | {{- if and (or .Params.editPost.URL site.Params.editPost.URL) (not (.Param "editPost.disabled")) -}} | ||||||
|  | {{- $fileUrlPath := path.Join .File.Path }} | ||||||
|  |  | ||||||
|  | {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}} | ||||||
|  | <a href="{{ .Params.editPost.URL | default site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer edit" target="_blank"> | ||||||
|  |     {{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} | ||||||
|  | </a> | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										3
									
								
								layouts/layouts/partials/extend_footer.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								layouts/layouts/partials/extend_footer.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | {{- /* Footer custom content area start */ -}} | ||||||
|  | {{- /*     Insert any custom code web-analytics, resources, etc. here */ -}} | ||||||
|  | {{- /* Footer custom content area end */ -}} | ||||||
							
								
								
									
										4
									
								
								layouts/layouts/partials/extend_head.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								layouts/layouts/partials/extend_head.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | {{- /* Head custom content area start */ -}} | ||||||
|  | {{- /*     Insert any custom code (web-analytics, resources, etc.) - it will appear in the <head></head> section of every page. */ -}} | ||||||
|  | {{- /*     Can be overwritten by partial with the same name in the global layouts. */ -}} | ||||||
|  | {{- /* Head custom content area end */ -}} | ||||||
							
								
								
									
										144
									
								
								layouts/layouts/partials/footer.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										144
									
								
								layouts/layouts/partials/footer.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,144 @@ | |||||||
|  | {{- if not (.Param "hideFooter") }} | ||||||
|  | <footer class="footer"> | ||||||
|  |     {{- if not site.Params.footer.hideCopyright }} | ||||||
|  |         {{- if site.Copyright }} | ||||||
|  |         <span>{{ site.Copyright | markdownify }}</span> | ||||||
|  |         {{- else }} | ||||||
|  |         <span>© {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ site.Title }}</a></span> | ||||||
|  |         {{- end }} | ||||||
|  |         {{- print " · "}} | ||||||
|  |     {{- end }} | ||||||
|  |  | ||||||
|  |     {{- with site.Params.footer.text }} | ||||||
|  |         {{ . | markdownify }} | ||||||
|  |         {{- print " · "}} | ||||||
|  |     {{- end }} | ||||||
|  |  | ||||||
|  |     <span> | ||||||
|  |         Powered by | ||||||
|  |         <a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> & | ||||||
|  |         <a href="https://github.com/adityatelange/hugo-PaperMod/" rel="noopener" target="_blank">PaperMod</a> | ||||||
|  |     </span> | ||||||
|  | </footer> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if (not site.Params.disableScrollToTop) }} | ||||||
|  | <a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g"> | ||||||
|  |     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor"> | ||||||
|  |         <path d="M12 6H0l6-6z" /> | ||||||
|  |     </svg> | ||||||
|  | </a> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- partial "extend_footer.html" . }} | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |     let menu = document.getElementById('menu') | ||||||
|  |     if (menu) { | ||||||
|  |         menu.scrollLeft = localStorage.getItem("menu-scroll-position"); | ||||||
|  |         menu.onscroll = function () { | ||||||
|  |             localStorage.setItem("menu-scroll-position", menu.scrollLeft); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     document.querySelectorAll('a[href^="#"]').forEach(anchor => { | ||||||
|  |         anchor.addEventListener("click", function (e) { | ||||||
|  |             e.preventDefault(); | ||||||
|  |             var id = this.getAttribute("href").substr(1); | ||||||
|  |             if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) { | ||||||
|  |                 document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({ | ||||||
|  |                     behavior: "smooth" | ||||||
|  |                 }); | ||||||
|  |             } else { | ||||||
|  |                 document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView(); | ||||||
|  |             } | ||||||
|  |             if (id === "top") { | ||||||
|  |                 history.replaceState(null, null, " "); | ||||||
|  |             } else { | ||||||
|  |                 history.pushState(null, null, `#${id}`); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | {{- if (not site.Params.disableScrollToTop) }} | ||||||
|  | <script> | ||||||
|  |     var mybutton = document.getElementById("top-link"); | ||||||
|  |     window.onscroll = function () { | ||||||
|  |         if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) { | ||||||
|  |             mybutton.style.visibility = "visible"; | ||||||
|  |             mybutton.style.opacity = "1"; | ||||||
|  |         } else { | ||||||
|  |             mybutton.style.visibility = "hidden"; | ||||||
|  |             mybutton.style.opacity = "0"; | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if (not site.Params.disableThemeToggle) }} | ||||||
|  | <script> | ||||||
|  |     document.getElementById("theme-toggle").addEventListener("click", () => { | ||||||
|  |         if (document.body.className.includes("dark")) { | ||||||
|  |             document.body.classList.remove('dark'); | ||||||
|  |             localStorage.setItem("pref-theme", 'light'); | ||||||
|  |         } else { | ||||||
|  |             document.body.classList.add('dark'); | ||||||
|  |             localStorage.setItem("pref-theme", 'dark'); | ||||||
|  |         } | ||||||
|  |     }) | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }} | ||||||
|  | <script> | ||||||
|  |     document.querySelectorAll('pre > code').forEach((codeblock) => { | ||||||
|  |         const container = codeblock.parentNode.parentNode; | ||||||
|  |  | ||||||
|  |         const copybutton = document.createElement('button'); | ||||||
|  |         copybutton.classList.add('copy-code'); | ||||||
|  |         copybutton.innerHTML = '{{- i18n "code_copy" | default "copy" }}'; | ||||||
|  |  | ||||||
|  |         function copyingDone() { | ||||||
|  |             copybutton.innerHTML = '{{- i18n "code_copied" | default "copied!" }}'; | ||||||
|  |             setTimeout(() => { | ||||||
|  |                 copybutton.innerHTML = '{{- i18n "code_copy" | default "copy" }}'; | ||||||
|  |             }, 2000); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         copybutton.addEventListener('click', (cb) => { | ||||||
|  |             if ('clipboard' in navigator) { | ||||||
|  |                 navigator.clipboard.writeText(codeblock.textContent); | ||||||
|  |                 copyingDone(); | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             const range = document.createRange(); | ||||||
|  |             range.selectNodeContents(codeblock); | ||||||
|  |             const selection = window.getSelection(); | ||||||
|  |             selection.removeAllRanges(); | ||||||
|  |             selection.addRange(range); | ||||||
|  |             try { | ||||||
|  |                 document.execCommand('copy'); | ||||||
|  |                 copyingDone(); | ||||||
|  |             } catch (e) { }; | ||||||
|  |             selection.removeRange(range); | ||||||
|  |         }); | ||||||
|  |  | ||||||
|  |         if (container.classList.contains("highlight")) { | ||||||
|  |             container.appendChild(copybutton); | ||||||
|  |         } else if (container.parentNode.firstChild == container) { | ||||||
|  |             // td containing LineNos | ||||||
|  |         } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") { | ||||||
|  |             // table containing LineNos and code | ||||||
|  |             codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton); | ||||||
|  |         } else { | ||||||
|  |             // code blocks not having highlight as parent class | ||||||
|  |             codeblock.parentNode.appendChild(copybutton); | ||||||
|  |         } | ||||||
|  |     }); | ||||||
|  | </script> | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										157
									
								
								layouts/layouts/partials/head.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								layouts/layouts/partials/head.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,157 @@ | |||||||
|  | <meta charset="utf-8"> | ||||||
|  | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||||
|  | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||||||
|  | {{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) }} | ||||||
|  | <meta name="robots" content="index, follow"> | ||||||
|  | {{- else }} | ||||||
|  | <meta name="robots" content="noindex, nofollow"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- /* Title */}} | ||||||
|  | <title>{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ site.Title }}</title> | ||||||
|  |  | ||||||
|  | {{- /* Meta */}} | ||||||
|  | {{- if .IsHome }} | ||||||
|  | {{ with site.Params.keywords -}}<meta name="keywords" content="{{- range $i, $e := . }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}">{{ end }} | ||||||
|  | {{- else }} | ||||||
|  | <meta name="keywords" content="{{ if .Params.keywords -}} | ||||||
|  |     {{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }} | ||||||
|  |     {{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}"> | ||||||
|  | {{- end }} | ||||||
|  | <meta name="description" content="{{- with .Description }}{{ . }}{{- else }}{{- if or .IsPage .IsSection}} | ||||||
|  |     {{- .Summary | default (printf "%s - %s" .Title  site.Title) }}{{- else }} | ||||||
|  |     {{- with site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> | ||||||
|  | <meta name="author" content="{{ (partial "author.html" . ) }}"> | ||||||
|  | <link rel="canonical" href="{{ if .Params.canonicalURL -}} {{ trim .Params.canonicalURL " " }} {{- else -}} {{ .Permalink }} {{- end }}"> | ||||||
|  | {{- if site.Params.analytics.google.SiteVerificationTag }} | ||||||
|  | <meta name="google-site-verification" content="{{ site.Params.analytics.google.SiteVerificationTag }}"> | ||||||
|  | {{- end }} | ||||||
|  | {{- if site.Params.analytics.yandex.SiteVerificationTag }} | ||||||
|  | <meta name="yandex-verification" content="{{ site.Params.analytics.yandex.SiteVerificationTag }}"> | ||||||
|  | {{- end }} | ||||||
|  | {{- if site.Params.analytics.bing.SiteVerificationTag }} | ||||||
|  | <meta name="msvalidate.01" content="{{ site.Params.analytics.bing.SiteVerificationTag }}"> | ||||||
|  | {{- end }} | ||||||
|  | {{- if site.Params.analytics.naver.SiteVerificationTag }} | ||||||
|  | <meta name="naver-site-verification" content="{{ site.Params.analytics.naver.SiteVerificationTag }}"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- /* Styles */}} | ||||||
|  |  | ||||||
|  | {{- /* includes */}} | ||||||
|  | {{- $includes := slice }} | ||||||
|  | {{- $includes = $includes | append (" " | resources.FromString "assets/css/includes-blank.css")}} | ||||||
|  |  | ||||||
|  | {{- if not (eq site.Params.assets.disableScrollBarStyle true) }} | ||||||
|  |     {{- $ScrollStyle := (resources.Get "css/includes/scroll-bar.css") }} | ||||||
|  |     {{- $includes = (append $ScrollStyle $includes) }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} | ||||||
|  |  | ||||||
|  | {{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} | ||||||
|  | {{- $reset := (resources.Get "css/core/reset.css") }} | ||||||
|  | {{- $media := (resources.Get "css/core/zmedia.css") }} | ||||||
|  | {{- $license_css := (resources.Get "css/core/license.css") }} | ||||||
|  | {{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} | ||||||
|  |  | ||||||
|  | {{- /* markup.highlight.noClasses should be set to `false` */}} | ||||||
|  | {{- $chroma_styles := (resources.Get "css/includes/chroma-styles.css") }} | ||||||
|  | {{- $chroma_mod := (resources.Get "css/includes/chroma-mod.css") }} | ||||||
|  |  | ||||||
|  | {{- /* order is important */}} | ||||||
|  | {{- $core := (slice $theme_vars $reset $common $chroma_styles $chroma_mod $includes_all $media) | resources.Concat "assets/css/core.css" | resources.Minify }} | ||||||
|  | {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" | resources.Minify }} | ||||||
|  |  | ||||||
|  | {{- /* bundle all required css */}} | ||||||
|  | {{- /* Add extended css after theme style */ -}} | ||||||
|  | {{- $stylesheet := (slice $license_css $core $extended) | resources.Concat "assets/css/stylesheet.css"  }} | ||||||
|  |  | ||||||
|  | {{- if not site.Params.assets.disableFingerprinting }} | ||||||
|  | {{- $stylesheet := $stylesheet | fingerprint }} | ||||||
|  | <link crossorigin="anonymous" href="{{ $stylesheet.RelPermalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" as="style"> | ||||||
|  | {{- else }} | ||||||
|  | <link crossorigin="anonymous" href="{{ $stylesheet.RelPermalink }}" rel="preload stylesheet" as="style"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- /* Search */}} | ||||||
|  | {{- if (eq .Layout `search`) -}} | ||||||
|  | <link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json"> | ||||||
|  | {{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }} | ||||||
|  | {{- $fusejs := resources.Get "js/fuse.basic.min.js" }} | ||||||
|  | {{- $license_js := resources.Get "js/license.js" }} | ||||||
|  | {{- if not site.Params.assets.disableFingerprinting }} | ||||||
|  | {{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }} | ||||||
|  | <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script> | ||||||
|  | {{- else }} | ||||||
|  | {{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }} | ||||||
|  | <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}"></script> | ||||||
|  | {{- end }} | ||||||
|  | {{- end -}} | ||||||
|  |  | ||||||
|  | {{- /* Favicons */}} | ||||||
|  | <link rel="icon" href="{{ site.Params.assets.favicon | default "favicon.ico" | absURL }}"> | ||||||
|  | <link rel="icon" type="image/png" sizes="16x16" href="{{ site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL }}"> | ||||||
|  | <link rel="icon" type="image/png" sizes="32x32" href="{{ site.Params.assets.favicon32x32 | default "favicon-32x32.png" | absURL }}"> | ||||||
|  | <link rel="apple-touch-icon" href="{{ site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | absURL }}"> | ||||||
|  | <link rel="mask-icon" href="{{ site.Params.assets.safari_pinned_tab | default "safari-pinned-tab.svg" | absURL }}"> | ||||||
|  | <meta name="theme-color" content="{{ site.Params.assets.theme_color | default "#2e2e33" }}"> | ||||||
|  | <meta name="msapplication-TileColor" content="{{ site.Params.assets.msapplication_TileColor | default "#2e2e33" }}"> | ||||||
|  |  | ||||||
|  | {{- /* RSS */}} | ||||||
|  | {{ range .AlternativeOutputFormats -}} | ||||||
|  | <link rel="{{ .Rel }}" type="{{ .MediaType.Type | html }}" href="{{ .Permalink | safeURL }}"> | ||||||
|  | {{ end -}} | ||||||
|  | {{- range .AllTranslations -}} | ||||||
|  | <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"> | ||||||
|  | {{ end -}} | ||||||
|  |  | ||||||
|  | <noscript> | ||||||
|  |     <style> | ||||||
|  |         #theme-toggle, | ||||||
|  |         .top-link { | ||||||
|  |             display: none; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |     </style> | ||||||
|  |     {{- if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark")) }} | ||||||
|  |     <style> | ||||||
|  |         @media (prefers-color-scheme: dark) { | ||||||
|  |             :root { | ||||||
|  |                 --theme: rgb(29, 30, 32); | ||||||
|  |                 --entry: rgb(46, 46, 51); | ||||||
|  |                 --primary: rgb(218, 218, 219); | ||||||
|  |                 --secondary: rgb(155, 156, 157); | ||||||
|  |                 --tertiary: rgb(65, 66, 68); | ||||||
|  |                 --content: rgb(196, 196, 197); | ||||||
|  |                 --code-block-bg: rgb(46, 46, 51); | ||||||
|  |                 --code-bg: rgb(55, 56, 62); | ||||||
|  |                 --border: rgb(51, 51, 51); | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             .list { | ||||||
|  |                 background: var(--theme); | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             .list:not(.dark)::-webkit-scrollbar-track { | ||||||
|  |                 background: 0 0; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             .list:not(.dark)::-webkit-scrollbar-thumb { | ||||||
|  |                 border-color: var(--theme); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |     </style> | ||||||
|  |     {{- end }} | ||||||
|  | </noscript> | ||||||
|  |  | ||||||
|  | {{- partial "extend_head.html" . -}} | ||||||
|  |  | ||||||
|  | {{- /* Misc */}} | ||||||
|  | {{- if hugo.IsProduction | or (eq site.Params.env "production") }} | ||||||
|  | {{- partial "google_analytics.html" . }} | ||||||
|  | {{- partial "templates/opengraph.html" . }} | ||||||
|  | {{- partial "templates/twitter_cards.html" . }} | ||||||
|  | {{- partial "templates/schema_json.html" . }} | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										149
									
								
								layouts/layouts/partials/header.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										149
									
								
								layouts/layouts/partials/header.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,149 @@ | |||||||
|  | {{- /* theme-toggle is enabled */}} | ||||||
|  | {{- if (not site.Params.disableThemeToggle) }} | ||||||
|  | {{- /* theme is light */}} | ||||||
|  | {{- if (eq site.Params.defaultTheme "light") }} | ||||||
|  | <script> | ||||||
|  |     if (localStorage.getItem("pref-theme") === "dark") { | ||||||
|  |         document.body.classList.add('dark'); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | {{- /* theme is dark */}} | ||||||
|  | {{- else if (eq site.Params.defaultTheme "dark") }} | ||||||
|  | <script> | ||||||
|  |     if (localStorage.getItem("pref-theme") === "light") { | ||||||
|  |         document.body.classList.remove('dark') | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | {{- else }} | ||||||
|  | {{- /* theme is auto */}} | ||||||
|  | <script> | ||||||
|  |     if (localStorage.getItem("pref-theme") === "dark") { | ||||||
|  |         document.body.classList.add('dark'); | ||||||
|  |     } else if (localStorage.getItem("pref-theme") === "light") { | ||||||
|  |         document.body.classList.remove('dark') | ||||||
|  |     } else if (window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||||||
|  |         document.body.classList.add('dark'); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | {{- end }} | ||||||
|  | {{- /* theme-toggle is disabled and theme is auto */}} | ||||||
|  | {{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}} | ||||||
|  | <script> | ||||||
|  |     if (window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||||||
|  |         document.body.classList.add('dark'); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | <header class="header"> | ||||||
|  |     <nav class="nav"> | ||||||
|  |         <div class="logo"> | ||||||
|  |             {{- $label_text := (site.Params.label.text | default site.Title) }} | ||||||
|  |             {{- if site.Title }} | ||||||
|  |             <a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)"> | ||||||
|  |                 {{- if site.Params.label.icon }} | ||||||
|  |                 {{- $img := resources.Get site.Params.label.icon }} | ||||||
|  |                 {{- if $img }} | ||||||
|  |                     {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} | ||||||
|  |                     {{- if hugo.IsExtended -}} | ||||||
|  |                         {{- $processableFormats = $processableFormats | append "webp" -}} | ||||||
|  |                     {{- end -}} | ||||||
|  |                     {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} | ||||||
|  |                     {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} | ||||||
|  |                         {{- if site.Params.label.iconHeight }} | ||||||
|  |                             {{- $img = $img.Resize (printf "x%d" site.Params.label.iconHeight) }} | ||||||
|  |                         {{ else }} | ||||||
|  |                             {{- $img = $img.Resize "x30" }} | ||||||
|  |                         {{- end }} | ||||||
|  |                     {{- end }} | ||||||
|  |                     <img src="{{ $img.Permalink }}" alt="" aria-label="logo" | ||||||
|  |                         height="{{- site.Params.label.iconHeight | default "30" -}}"> | ||||||
|  |                 {{- else }} | ||||||
|  |                 <img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo" | ||||||
|  |                     height="{{- site.Params.label.iconHeight | default "30" -}}"> | ||||||
|  |                 {{- end -}} | ||||||
|  |                 {{- else if hasPrefix site.Params.label.iconSVG "<svg" }} | ||||||
|  |                     {{ site.Params.label.iconSVG | safeHTML }} | ||||||
|  |                 {{- end -}} | ||||||
|  |                 {{- $label_text -}} | ||||||
|  |             </a> | ||||||
|  |             {{- end }} | ||||||
|  |             <div class="logo-switches"> | ||||||
|  |                 {{- if (not site.Params.disableThemeToggle) }} | ||||||
|  |                 <button id="theme-toggle" accesskey="t" title="(Alt + T)" aria-label="Toggle theme"> | ||||||
|  |                     <svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" | ||||||
|  |                         fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" | ||||||
|  |                         stroke-linejoin="round"> | ||||||
|  |                         <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path> | ||||||
|  |                     </svg> | ||||||
|  |                     <svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" | ||||||
|  |                         fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" | ||||||
|  |                         stroke-linejoin="round"> | ||||||
|  |                         <circle cx="12" cy="12" r="5"></circle> | ||||||
|  |                         <line x1="12" y1="1" x2="12" y2="3"></line> | ||||||
|  |                         <line x1="12" y1="21" x2="12" y2="23"></line> | ||||||
|  |                         <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> | ||||||
|  |                         <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> | ||||||
|  |                         <line x1="1" y1="12" x2="3" y2="12"></line> | ||||||
|  |                         <line x1="21" y1="12" x2="23" y2="12"></line> | ||||||
|  |                         <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> | ||||||
|  |                         <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> | ||||||
|  |                     </svg> | ||||||
|  |                 </button> | ||||||
|  |                 {{- end }} | ||||||
|  |  | ||||||
|  |                 {{- $lang := .Lang}} | ||||||
|  |                 {{- $separator := or $label_text (not site.Params.disableThemeToggle)}} | ||||||
|  |                 {{- with site.Home.Translations }} | ||||||
|  |                 <ul class="lang-switch"> | ||||||
|  |                     {{- if $separator }}<li>|</li>{{ end }} | ||||||
|  |                     {{- range . -}} | ||||||
|  |                     {{- if ne $lang .Lang }} | ||||||
|  |                     <li> | ||||||
|  |                         <a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}" | ||||||
|  |                             aria-label="{{ .Language.LanguageName | default (.Lang | title) }}"> | ||||||
|  |                             {{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }} | ||||||
|  |                             {{- .Language.LanguageName | emojify -}} | ||||||
|  |                             {{- else }} | ||||||
|  |                             {{- .Lang | title -}} | ||||||
|  |                             {{- end -}} | ||||||
|  |                         </a> | ||||||
|  |                     </li> | ||||||
|  |                     {{- end -}} | ||||||
|  |                     {{- end}} | ||||||
|  |                 </ul> | ||||||
|  |                 {{- end }} | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |         {{- $currentPage := . }} | ||||||
|  |         <ul id="menu"> | ||||||
|  |             {{- range site.Menus.main }} | ||||||
|  |             {{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }} | ||||||
|  |             {{- $page_url:= $currentPage.Permalink | absLangURL }} | ||||||
|  |             {{- $is_search := eq (site.GetPage .KeyName).Layout `search` }} | ||||||
|  |             <li> | ||||||
|  |                 <a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}" | ||||||
|  |                 {{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}> | ||||||
|  |                     <span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}> | ||||||
|  |                         {{- .Pre }} | ||||||
|  |                         {{- .Name -}} | ||||||
|  |                         {{ .Post -}} | ||||||
|  |                     </span> | ||||||
|  |                     {{- if (findRE "://" .URL) }}  | ||||||
|  |                     <svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round" | ||||||
|  |                         stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="12" width="12"> | ||||||
|  |                         <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path> | ||||||
|  |                         <path d="M15 3h6v6"></path> | ||||||
|  |                         <path d="M10 14L21 3"></path> | ||||||
|  |                     </svg> | ||||||
|  |                     {{- end }} | ||||||
|  |                 </a> | ||||||
|  |             </li> | ||||||
|  |             {{- end }} | ||||||
|  |         </ul> | ||||||
|  |     </nav> | ||||||
|  | </header> | ||||||
							
								
								
									
										13
									
								
								layouts/layouts/partials/home_info.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								layouts/layouts/partials/home_info.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | {{- with site.Params.homeInfoParams }} | ||||||
|  | <article class="first-entry home-info"> | ||||||
|  |     <header class="entry-header"> | ||||||
|  |         <h1>{{ .Title | markdownify }}</h1> | ||||||
|  |     </header> | ||||||
|  |     <div class="entry-content"> | ||||||
|  |         {{ .Content | markdownify }} | ||||||
|  |     </div> | ||||||
|  |     <footer class="entry-footer"> | ||||||
|  |         {{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }} | ||||||
|  |     </footer> | ||||||
|  | </article> | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										58
									
								
								layouts/layouts/partials/index_profile.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								layouts/layouts/partials/index_profile.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,58 @@ | |||||||
|  | <div class="profile"> | ||||||
|  |     {{- with site.Params.profileMode }} | ||||||
|  |     <div class="profile_inner"> | ||||||
|  |         {{- if .imageUrl -}} | ||||||
|  |         {{- $img := "" }} | ||||||
|  |         {{- if not (urls.Parse .imageUrl).IsAbs }} | ||||||
|  |             {{- $img = resources.Get .imageUrl }} | ||||||
|  |         {{- end }} | ||||||
|  |         {{- if $img }} | ||||||
|  |             {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} | ||||||
|  |             {{- if hugo.IsExtended -}} | ||||||
|  |                 {{- $processableFormats = $processableFormats | append "webp" -}} | ||||||
|  |             {{- end -}} | ||||||
|  |             {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} | ||||||
|  |             {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} | ||||||
|  |                 {{- if (not (and (not .imageHeight) (not .imageWidth))) }} | ||||||
|  |                     {{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }} | ||||||
|  |                 {{- else if .imageHeight }} | ||||||
|  |                     {{- $img = $img.Resize (printf "x%d" .imageHeight) }} | ||||||
|  |                 {{ else if .imageWidth }} | ||||||
|  |                     {{- $img = $img.Resize (printf "%dx" .imageWidth) }} | ||||||
|  |                 {{ else }} | ||||||
|  |                     {{- $img = $img.Resize "150x150" }} | ||||||
|  |                 {{- end }} | ||||||
|  |             {{- end }} | ||||||
|  |             <img draggable="false" src="{{ $img.Permalink }}" alt="{{ .imageTitle | default "profile image" }}" title="{{ .imageTitle }}" | ||||||
|  |                 height="{{ .imageHeight | default 150 }}" width="{{ .imageWidth | default 150 }}" /> | ||||||
|  |         {{- else }} | ||||||
|  |         <img draggable="false" src="{{ .imageUrl | absURL }}" alt="{{ .imageTitle | default "profile image" }}" title="{{ .imageTitle }}" | ||||||
|  |             height="{{ .imageHeight | default 150 }}" width="{{ .imageWidth | default 150 }}" /> | ||||||
|  |         {{- end }} | ||||||
|  |         {{- end }} | ||||||
|  |         <h1>{{ .title | default site.Title | markdownify }}</h1> | ||||||
|  |         <span>{{ .subtitle | markdownify }}</span> | ||||||
|  |         {{- partial "social_icons.html" -}} | ||||||
|  |  | ||||||
|  |         {{- with .buttons }} | ||||||
|  |         <div class="buttons"> | ||||||
|  |             {{- range . }} | ||||||
|  |             <a class="button" href="{{ trim .url " " }}" rel="noopener" title="{{ .name }}"> | ||||||
|  |                 <span class="button-inner"> | ||||||
|  |                     {{ .name }} | ||||||
|  |                     {{- if (findRE "://" .url) }}  | ||||||
|  |                     <svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round" | ||||||
|  |                         stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="14" width="14"> | ||||||
|  |                         <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path> | ||||||
|  |                         <path d="M15 3h6v6"></path> | ||||||
|  |                         <path d="M10 14L21 3"></path> | ||||||
|  |                     </svg> | ||||||
|  |                     {{- end }} | ||||||
|  |                 </span> | ||||||
|  |             </a> | ||||||
|  |             {{- end }} | ||||||
|  |         </div> | ||||||
|  |         {{- end }} | ||||||
|  |     </div> | ||||||
|  |     {{- end}} | ||||||
|  | </div> | ||||||
							
								
								
									
										9
									
								
								layouts/layouts/partials/post_canonical.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								layouts/layouts/partials/post_canonical.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | {{ if and (.Params.canonicalURL) (.Params.ShowCanonicalLink ) -}} | ||||||
|  | {{ $url := urls.Parse .Params.canonicalURL }} | ||||||
|  |  | ||||||
|  | {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }} | {{- end -}} | ||||||
|  | <span> | ||||||
|  |     {{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}} | ||||||
|  |      <a href="{{ trim .Params.canonicalURL " " }}" title="{{ trim .Params.canonicalURL " " }}" target="_blank" rel="noopener noreferrer">{{ $url.Host }}</a> | ||||||
|  | </span> | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										23
									
								
								layouts/layouts/partials/post_meta.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								layouts/layouts/partials/post_meta.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | {{- $scratch := newScratch }} | ||||||
|  |  | ||||||
|  | {{- if not .Date.IsZero -}} | ||||||
|  | {{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if (.Param "ShowReadingTime") -}} | ||||||
|  | {{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if (.Param "ShowWordCount") -}} | ||||||
|  | {{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if not (.Param "hideAuthor") -}} | ||||||
|  | {{- with (partial "author.html" .) }} | ||||||
|  | {{- $scratch.Add "meta" (slice .) }} | ||||||
|  | {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with ($scratch.Get "meta") }} | ||||||
|  | {{- delimit . " · " | safeHTML -}} | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										19
									
								
								layouts/layouts/partials/post_nav_links.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								layouts/layouts/partials/post_nav_links.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} | ||||||
|  | {{- if and (gt (len $pages) 1) (in $pages . ) }} | ||||||
|  | <nav class="paginav"> | ||||||
|  |   {{- with $pages.Next . }} | ||||||
|  |   <a class="prev" href="{{ .Permalink }}"> | ||||||
|  |     <span class="title">« {{ i18n "prev_page" }}</span> | ||||||
|  |     <br> | ||||||
|  |     <span>{{- .Name -}}</span> | ||||||
|  |   </a> | ||||||
|  |   {{- end }} | ||||||
|  |   {{- with $pages.Prev . }} | ||||||
|  |   <a class="next" href="{{ .Permalink }}"> | ||||||
|  |     <span class="title">{{ i18n "next_page" }} »</span> | ||||||
|  |     <br> | ||||||
|  |     <span>{{- .Name -}}</span> | ||||||
|  |   </a> | ||||||
|  |   {{- end }} | ||||||
|  | </nav> | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										95
									
								
								layouts/layouts/partials/share_icons.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								layouts/layouts/partials/share_icons.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,95 @@ | |||||||
|  | {{- $pageurl := .Permalink }} | ||||||
|  | {{- $title := .Title }} | ||||||
|  |  | ||||||
|  | {{- $.Scratch.Set "tags" ""}} | ||||||
|  |  | ||||||
|  | {{- with .Params.Tags }} | ||||||
|  | {{- $hashtags := newScratch}} | ||||||
|  | {{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} | ||||||
|  | {{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} | ||||||
|  | {{- end -}} | ||||||
|  |  | ||||||
|  | {{- $custom := false }} | ||||||
|  | {{- $ShareButtons := (.Param "ShareButtons")}} | ||||||
|  | {{- with $ShareButtons }}{{ $custom = true }}{{ end }} | ||||||
|  |  | ||||||
|  | <ul class="share-buttons"> | ||||||
|  |     {{- if (or (cond ($custom) (in $ShareButtons "x") (true)) (cond ($custom) (in $ShareButtons "twitter") (true))) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on x" | ||||||
|  |             href="https://x.com/intent/tweet/?text={{ $title }}&url={{ $pageurl }}&hashtags={{- $.Scratch.Get "tags" -}}"> | ||||||
|  |             <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> | ||||||
|  |                 <path | ||||||
|  |                     d="M512 62.554 L 512 449.446 C 512 483.97 483.97 512 449.446 512 L 62.554 512 C 28.03 512 0 483.97 0 449.446 L 0 62.554 C 0 28.03 28.029 0 62.554 0 L 449.446 0 C 483.971 0 512 28.03 512 62.554 Z M 269.951 190.75 L 182.567 75.216 L 56 75.216 L 207.216 272.95 L 63.9 436.783 L 125.266 436.783 L 235.9 310.383 L 332.567 436.783 L 456 436.783 L 298.367 228.367 L 432.367 75.216 L 371.033 75.216 Z M 127.633 110 L 164.101 110 L 383.481 400.065 L 349.5 400.065 Z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on linkedin" | ||||||
|  |             href="https://www.linkedin.com/shareArticle?mini=true&url={{ $pageurl }}&title={{ $title }}&summary={{ $title }}&source={{ $pageurl }}"> | ||||||
|  |             <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> | ||||||
|  |                 <path | ||||||
|  |                     d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-288.985,423.278l0,-225.717l-75.04,0l0,225.717l75.04,0Zm270.539,0l0,-129.439c0,-69.333 -37.018,-101.586 -86.381,-101.586c-39.804,0 -57.634,21.891 -67.617,37.266l0,-31.958l-75.021,0c0.995,21.181 0,225.717 0,225.717l75.02,0l0,-126.056c0,-6.748 0.486,-13.492 2.474,-18.315c5.414,-13.475 17.767,-27.434 38.494,-27.434c27.135,0 38.007,20.707 38.007,51.037l0,120.768l75.024,0Zm-307.552,-334.556c-25.674,0 -42.448,16.879 -42.448,39.002c0,21.658 16.264,39.002 41.455,39.002l0.484,0c26.165,0 42.452,-17.344 42.452,-39.002c-0.485,-22.092 -16.241,-38.954 -41.943,-39.002Z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on reddit" | ||||||
|  |             href="https://reddit.com/submit?url={{ $pageurl }}&title={{ $title }}"> | ||||||
|  |             <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> | ||||||
|  |                 <path | ||||||
|  |                     d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-3.446,265.638c0,-22.964 -18.616,-41.58 -41.58,-41.58c-11.211,0 -21.361,4.457 -28.841,11.666c-28.424,-20.508 -67.586,-33.757 -111.204,-35.278l18.941,-89.121l61.884,13.157c0.756,15.734 13.642,28.29 29.56,28.29c16.407,0 29.706,-13.299 29.706,-29.701c0,-16.403 -13.299,-29.702 -29.706,-29.702c-11.666,0 -21.657,6.792 -26.515,16.578l-69.105,-14.69c-1.922,-0.418 -3.939,-0.042 -5.585,1.036c-1.658,1.073 -2.811,2.761 -3.224,4.686l-21.152,99.438c-44.258,1.228 -84.046,14.494 -112.837,35.232c-7.468,-7.164 -17.589,-11.591 -28.757,-11.591c-22.965,0 -41.585,18.616 -41.585,41.58c0,16.896 10.095,31.41 24.568,37.918c-0.639,4.135 -0.99,8.328 -0.99,12.576c0,63.977 74.469,115.836 166.33,115.836c91.861,0 166.334,-51.859 166.334,-115.836c0,-4.218 -0.347,-8.387 -0.977,-12.493c14.564,-6.47 24.735,-21.034 24.735,-38.001Zm-119.474,108.193c-20.27,20.241 -59.115,21.816 -70.534,21.816c-11.428,0 -50.277,-1.575 -70.522,-21.82c-3.007,-3.008 -3.007,-7.882 0,-10.889c3.003,-2.999 7.882,-3.003 10.885,0c12.777,12.781 40.11,17.317 59.637,17.317c19.522,0 46.86,-4.536 59.657,-17.321c3.016,-2.999 7.886,-2.995 10.885,0.008c3.008,3.011 3.003,7.882 -0.008,10.889Zm-5.23,-48.781c-16.373,0 -29.701,-13.324 -29.701,-29.698c0,-16.381 13.328,-29.714 29.701,-29.714c16.378,0 29.706,13.333 29.706,29.714c0,16.374 -13.328,29.698 -29.706,29.698Zm-160.386,-29.702c0,-16.381 13.328,-29.71 29.714,-29.71c16.369,0 29.689,13.329 29.689,29.71c0,16.373 -13.32,29.693 -29.689,29.693c-16.386,0 -29.714,-13.32 -29.714,-29.693Z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on facebook" | ||||||
|  |             href="https://facebook.com/sharer/sharer.php?u={{ $pageurl }}"> | ||||||
|  |             <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> | ||||||
|  |                 <path | ||||||
|  |                     d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-106.468,0l0,-192.915l66.6,0l12.672,-82.621l-79.272,0l0,-53.617c0,-22.603 11.073,-44.636 46.58,-44.636l36.042,0l0,-70.34c0,0 -32.71,-5.582 -63.982,-5.582c-65.288,0 -107.96,39.569 -107.96,111.204l0,62.971l-72.573,0l0,82.621l72.573,0l0,192.915l-191.104,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on whatsapp" | ||||||
|  |             href="https://api.whatsapp.com/send?text={{ $title }}%20-%20{{ $pageurl }}"> | ||||||
|  |             <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> | ||||||
|  |                 <path | ||||||
|  |                     d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-58.673,127.703c-33.842,-33.881 -78.847,-52.548 -126.798,-52.568c-98.799,0 -179.21,80.405 -179.249,179.234c-0.013,31.593 8.241,62.428 23.927,89.612l-25.429,92.884l95.021,-24.925c26.181,14.28 55.659,21.807 85.658,21.816l0.074,0c98.789,0 179.206,-80.413 179.247,-179.243c0.018,-47.895 -18.61,-92.93 -52.451,-126.81Zm-126.797,275.782l-0.06,0c-26.734,-0.01 -52.954,-7.193 -75.828,-20.767l-5.441,-3.229l-56.386,14.792l15.05,-54.977l-3.542,-5.637c-14.913,-23.72 -22.791,-51.136 -22.779,-79.287c0.033,-82.142 66.867,-148.971 149.046,-148.971c39.793,0.014 77.199,15.531 105.329,43.692c28.128,28.16 43.609,65.592 43.594,105.4c-0.034,82.149 -66.866,148.983 -148.983,148.984Zm81.721,-111.581c-4.479,-2.242 -26.499,-13.075 -30.604,-14.571c-4.105,-1.495 -7.091,-2.241 -10.077,2.241c-2.986,4.483 -11.569,14.572 -14.182,17.562c-2.612,2.988 -5.225,3.364 -9.703,1.12c-4.479,-2.241 -18.91,-6.97 -36.017,-22.23c-13.314,-11.876 -22.304,-26.542 -24.916,-31.026c-2.612,-4.484 -0.279,-6.908 1.963,-9.14c2.016,-2.007 4.48,-5.232 6.719,-7.847c2.24,-2.615 2.986,-4.484 4.479,-7.472c1.493,-2.99 0.747,-5.604 -0.374,-7.846c-1.119,-2.241 -10.077,-24.288 -13.809,-33.256c-3.635,-8.733 -7.327,-7.55 -10.077,-7.688c-2.609,-0.13 -5.598,-0.158 -8.583,-0.158c-2.986,0 -7.839,1.121 -11.944,5.604c-4.105,4.484 -15.675,15.32 -15.675,37.364c0,22.046 16.048,43.342 18.287,46.332c2.24,2.99 31.582,48.227 76.511,67.627c10.685,4.615 19.028,7.371 25.533,9.434c10.728,3.41 20.492,2.929 28.209,1.775c8.605,-1.285 26.499,-10.833 30.231,-21.295c3.732,-10.464 3.732,-19.431 2.612,-21.298c-1.119,-1.869 -4.105,-2.99 -8.583,-5.232Z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on telegram" | ||||||
|  |             href="https://telegram.me/share/url?text={{ $title }}&url={{ $pageurl }}"> | ||||||
|  |             <svg version="1.1" xml:space="preserve" viewBox="2 2 28 28" height="30px" width="30px" fill="currentColor"> | ||||||
|  |                 <path | ||||||
|  |                     d="M26.49,29.86H5.5a3.37,3.37,0,0,1-2.47-1,3.35,3.35,0,0,1-1-2.47V5.48A3.36,3.36,0,0,1,3,3,3.37,3.37,0,0,1,5.5,2h21A3.38,3.38,0,0,1,29,3a3.36,3.36,0,0,1,1,2.46V26.37a3.35,3.35,0,0,1-1,2.47A3.38,3.38,0,0,1,26.49,29.86Zm-5.38-6.71a.79.79,0,0,0,.85-.66L24.73,9.24a.55.55,0,0,0-.18-.46.62.62,0,0,0-.41-.17q-.08,0-16.53,6.11a.59.59,0,0,0-.41.59.57.57,0,0,0,.43.52l4,1.24,1.61,4.83a.62.62,0,0,0,.63.43.56.56,0,0,0,.4-.17L16.54,20l4.09,3A.9.9,0,0,0,21.11,23.15ZM13.8,20.71l-1.21-4q8.72-5.55,8.78-5.55c.15,0,.23,0,.23.16a.18.18,0,0,1,0,.06s-2.51,2.3-7.52,6.8Z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  |     {{- if (cond ($custom) (in $ShareButtons "ycombinator") (true)) }} | ||||||
|  |     <li> | ||||||
|  |         <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on ycombinator" | ||||||
|  |             href="https://news.ycombinator.com/submitlink?t={{ $title }}&u={{ $pageurl }}"> | ||||||
|  |             <svg version="1.1" xml:space="preserve" width="30px" height="30px" viewBox="0 0 512 512" fill="currentColor" | ||||||
|  |                 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"> | ||||||
|  |                 <path | ||||||
|  |                     d="M449.446 0C483.971 0 512 28.03 512 62.554L512 449.446C512 483.97 483.97 512 449.446 512L62.554 512C28.03 512 0 483.97 0 449.446L0 62.554C0 28.03 28.029 0 62.554 0L449.446 0ZM183.8767 87.9921H121.8427L230.6673 292.4508V424.0079H281.3328V292.4508L390.1575 87.9921H328.1233L256 238.2489z" /> | ||||||
|  |             </svg> | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  | </ul> | ||||||
							
								
								
									
										8
									
								
								layouts/layouts/partials/social_icons.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								layouts/layouts/partials/social_icons.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | <div class="social-icons" {{ with .align}}align="{{.}}" {{- end }}> | ||||||
|  |     {{- range site.Params.socialIcons }} | ||||||
|  |     <a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me" | ||||||
|  |         title="{{ (.title | default .name) | title }}"> | ||||||
|  |         {{ partial "svg.html" . }} | ||||||
|  |     </a> | ||||||
|  |     {{- end }} | ||||||
|  | </div> | ||||||
							
								
								
									
										988
									
								
								layouts/layouts/partials/svg.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										988
									
								
								layouts/layouts/partials/svg.html
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -0,0 +1,47 @@ | |||||||
|  | {{- $imgs := slice }} | ||||||
|  | {{- $imgParams := .Params.images }} | ||||||
|  | {{- $resources := .Resources.ByType "image" -}} | ||||||
|  | {{/* Find featured image resources if the images parameter is empty. */}} | ||||||
|  | {{- if not $imgParams }} | ||||||
|  |   {{- $featured := $resources.GetMatch "*feature*" -}} | ||||||
|  |   {{- if not $featured }}{{ $featured = $resources.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} | ||||||
|  |   {{- with $featured }} | ||||||
|  |     {{- $imgs = $imgs | append (dict | ||||||
|  |       "Image" . | ||||||
|  |       "RelPermalink" .RelPermalink | ||||||
|  |       "Permalink" .Permalink) }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  | {{/* Use the first one of site images as the fallback. */}} | ||||||
|  | {{- if and (not $imgParams) (not $imgs) }} | ||||||
|  |   {{- with site.Params.images }} | ||||||
|  |     {{- $imgParams = first 1 . }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  | {{/* Parse page's images parameter. */}} | ||||||
|  | {{- range $imgParams }} | ||||||
|  |   {{- $img := . }} | ||||||
|  |   {{- $url := urls.Parse $img }} | ||||||
|  |   {{- if eq $url.Scheme "" }} | ||||||
|  |     {{/* Internal image. */}} | ||||||
|  |     {{- with $resources.GetMatch $img -}} | ||||||
|  |       {{/* Image resource. */}} | ||||||
|  |       {{- $imgs = $imgs | append (dict | ||||||
|  |         "Image" . | ||||||
|  |         "RelPermalink" .RelPermalink | ||||||
|  |         "Permalink" .Permalink) }} | ||||||
|  |     {{- else }} | ||||||
|  |       {{- $imgs = $imgs | append (dict | ||||||
|  |         "RelPermalink" (relURL $img) | ||||||
|  |         "Permalink" (absURL $img) | ||||||
|  |       ) }} | ||||||
|  |     {{- end }} | ||||||
|  |   {{- else }} | ||||||
|  |     {{/* External image */}} | ||||||
|  |     {{- $imgs = $imgs | append (dict | ||||||
|  |       "RelPermalink" $img | ||||||
|  |       "Permalink" $img | ||||||
|  |     ) }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  | {{- return $imgs }} | ||||||
							
								
								
									
										86
									
								
								layouts/layouts/partials/templates/opengraph.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								layouts/layouts/partials/templates/opengraph.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,86 @@ | |||||||
|  | <meta property="og:url" content="{{ .Permalink }}"> | ||||||
|  |  | ||||||
|  | {{- with or site.Title site.Params.title | plainify }} | ||||||
|  |   <meta property="og:site_name" content="{{ . }}"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with or .Title site.Title site.Params.title | plainify }} | ||||||
|  |   <meta property="og:title" content="{{ . }}"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }} | ||||||
|  |   <meta property="og:description" content="{{ . }}"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with or .Params.locale site.Language.LanguageCode site.Language.Lang }} | ||||||
|  |   <meta property="og:locale" content="{{ . }}"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if .IsPage }} | ||||||
|  |   <meta property="og:type" content="article"> | ||||||
|  |   {{- with .Section }} | ||||||
|  |     <meta property="article:section" content="{{ . }}"> | ||||||
|  |   {{- end }} | ||||||
|  |   {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} | ||||||
|  |   {{- with .PublishDate }} | ||||||
|  |     <meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}> | ||||||
|  |   {{- end }} | ||||||
|  |   {{- with .Lastmod }} | ||||||
|  |     <meta property="article:modified_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}> | ||||||
|  |   {{- end }} | ||||||
|  |   {{- range .GetTerms "tags" | first 6 }} | ||||||
|  |     <meta property="article:tag" content="{{ .Page.Title | plainify }}"> | ||||||
|  |   {{- end }} | ||||||
|  | {{- else }} | ||||||
|  |   <meta property="og:type" content="website"> | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if .Params.cover.image -}} | ||||||
|  |   {{- if (ne .Params.cover.relative true) }} | ||||||
|  |     <meta property="og:image" content="{{ .Params.cover.image | absURL }}"> | ||||||
|  |   {{- else}} | ||||||
|  |     <meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}"> | ||||||
|  |   {{- end}} | ||||||
|  | {{- else }} | ||||||
|  |   {{- with partial "_funcs/get-page-images" . }} | ||||||
|  |     {{- range . | first 6 }} | ||||||
|  |       <meta property="og:image" content="{{ .Permalink }}"> | ||||||
|  |     {{- end }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with .Params.audio }} | ||||||
|  |   {{- range . | first 6  }} | ||||||
|  |     <meta property="og:audio" content="{{ . | absURL }}"> | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with .Params.videos }} | ||||||
|  |   {{- range . | first 6 }} | ||||||
|  |     <meta property="og:video" content="{{ . | absURL }}"> | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- range .GetTerms "series" }} | ||||||
|  |   {{- range .Pages | first 7 }} | ||||||
|  |     {{- if ne $ . }} | ||||||
|  |       <meta property="og:see_also" content="{{ .Permalink }}"> | ||||||
|  |     {{- end }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with site.Params.social }} | ||||||
|  |   {{- if reflect.IsMap . }} | ||||||
|  |     {{- with .facebook_app_id }} | ||||||
|  |       <meta property="fb:app_id" content="{{ . }}"> | ||||||
|  |     {{- else }} | ||||||
|  |       {{- with .facebook_admin }} | ||||||
|  |         <meta property="fb:admins" content="{{ . }}"> | ||||||
|  |       {{- end }} | ||||||
|  |     {{- end }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with (.Param "social.fediverse_creator") }} | ||||||
|  |   <meta name="fediverse:creator" content="{{ . }}"> | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										128
									
								
								layouts/layouts/partials/templates/schema_json.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										128
									
								
								layouts/layouts/partials/templates/schema_json.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,128 @@ | |||||||
|  | {{ if .IsHome }} | ||||||
|  | <script type="application/ld+json"> | ||||||
|  | { | ||||||
|  |   "@context": "https://schema.org", | ||||||
|  |   "@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}", | ||||||
|  |   "name": {{ site.Title }}, | ||||||
|  |   "url": {{ site.Home.Permalink }}, | ||||||
|  |   "description": {{ site.Params.description | plainify | truncate 180 | safeHTML }}, | ||||||
|  |   {{- if (eq site.Params.schema.publisherType "Person") }} | ||||||
|  |   "image": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }}, | ||||||
|  |   {{- else }} | ||||||
|  |   "logo": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }}, | ||||||
|  |   {{- end }} | ||||||
|  |   "sameAs": [ | ||||||
|  |     {{- if site.Params.schema.sameAs }} | ||||||
|  |       {{ range $i, $e := site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }} | ||||||
|  |     {{- else}} | ||||||
|  |       {{ range $i, $e := site.Params.SocialIcons }}{{ if $i }}, {{ end }}{{ trim $e.url " " | safeURL }}{{ end }} | ||||||
|  |     {{- end}} | ||||||
|  |   ] | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | {{- else if (or .IsPage .IsSection) }} | ||||||
|  | {{/* BreadcrumbList */}} | ||||||
|  | {{- $url := replace .Parent.Permalink ( printf "%s" site.Home.Permalink) "" }} | ||||||
|  | {{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} | ||||||
|  | {{- $bc_list := (split $lang_url "/")}} | ||||||
|  |  | ||||||
|  | {{- $scratch := newScratch }} | ||||||
|  | <script type="application/ld+json"> | ||||||
|  | { | ||||||
|  |   "@context": "https://schema.org", | ||||||
|  |   "@type": "BreadcrumbList", | ||||||
|  |   "itemListElement": [ | ||||||
|  |   {{- range $index, $element := $bc_list }} | ||||||
|  |  | ||||||
|  |     {{- $scratch.Add "path" (printf "%s/" $element ) | safeJS }} | ||||||
|  |     {{- $bc_pg := site.GetPage ($scratch.Get "path") -}} | ||||||
|  |  | ||||||
|  |     {{- if (and ($bc_pg) (gt (len . ) 0))}} | ||||||
|  |     {{- if (and $index)}}, {{end }} | ||||||
|  |     { | ||||||
|  |       "@type": "ListItem", | ||||||
|  |       "position": {{ add 1 $index  }}, | ||||||
|  |       "name": {{ $bc_pg.Name }}, | ||||||
|  |       "item": {{ $bc_pg.Permalink | safeHTML }} | ||||||
|  |     } | ||||||
|  |     {{- end }} | ||||||
|  |  | ||||||
|  |   {{- end }} | ||||||
|  |   {{- /*  self-page addition  */ -}} | ||||||
|  |   {{- if (ge (len $bc_list) 2) }}, {{end }} | ||||||
|  |     { | ||||||
|  |       "@type": "ListItem", | ||||||
|  |       "position": {{len $bc_list}}, | ||||||
|  |       "name": {{ .Name }}, | ||||||
|  |       "item": {{ .Permalink | safeHTML }} | ||||||
|  |     } | ||||||
|  |   ] | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | {{- if .IsPage }} | ||||||
|  | <script type="application/ld+json"> | ||||||
|  | { | ||||||
|  |   "@context": "https://schema.org", | ||||||
|  |   "@type": "BlogPosting", | ||||||
|  |   "headline": {{ .Title | plainify}}, | ||||||
|  |   "name": "{{ .Title | plainify }}", | ||||||
|  |   "description": {{ with .Description | plainify }}{{ . }}{{ else }}{{ .Summary | plainify  }}{{ end -}}, | ||||||
|  |   "keywords": [ | ||||||
|  |     {{- if .Params.keywords }} | ||||||
|  |     {{ range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} | ||||||
|  |     {{- else }} | ||||||
|  |     {{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} | ||||||
|  |     {{- end }} | ||||||
|  |   ], | ||||||
|  |   "articleBody": {{ .Content | safeJS | htmlUnescape | plainify }}, | ||||||
|  |   "wordCount" : "{{ .WordCount }}", | ||||||
|  |   "inLanguage": {{ .Language.Lang | default "en-us" }}, | ||||||
|  |   {{ if .Params.cover.image -}} | ||||||
|  |   "image": | ||||||
|  |     {{- if (ne .Params.cover.relative true) -}} | ||||||
|  |     {{ .Params.cover.image | absURL }}, | ||||||
|  |     {{- else -}} | ||||||
|  |     {{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}, | ||||||
|  |     {{- end}} | ||||||
|  |   {{- else }} | ||||||
|  |     {{- $images := partial "templates/_funcs/get-page-images" . -}} | ||||||
|  |     {{- with index $images 0 -}} | ||||||
|  |   "image": {{ .Permalink }}, | ||||||
|  |     {{- end }} | ||||||
|  |   {{- end -}} | ||||||
|  |   "datePublished": {{ .PublishDate }}, | ||||||
|  |   "dateModified": {{ .Lastmod }}, | ||||||
|  |   {{- with (.Params.author | default site.Params.author) }} | ||||||
|  |   "author": | ||||||
|  |     {{- if (or (eq (printf "%T" .) "[]string") (eq (printf "%T" .) "[]interface {}")) -}} | ||||||
|  |   [{{- range $i, $v := . -}} | ||||||
|  |   {{- if $i }}, {{end -}} | ||||||
|  |   { | ||||||
|  |     "@type": "Person", | ||||||
|  |     "name": {{ $v }} | ||||||
|  |   } | ||||||
|  |   {{- end }}], | ||||||
|  |     {{- else -}} | ||||||
|  |   { | ||||||
|  |     "@type": "Person", | ||||||
|  |     "name": {{ . }} | ||||||
|  |   }, | ||||||
|  |     {{- end -}} | ||||||
|  |   {{- end }} | ||||||
|  |   "mainEntityOfPage": { | ||||||
|  |     "@type": "WebPage", | ||||||
|  |     "@id": {{ .Permalink | safeHTML }} | ||||||
|  |   }, | ||||||
|  |   "publisher": { | ||||||
|  |     "@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}", | ||||||
|  |     "name": {{ site.Title }}, | ||||||
|  |     "logo": { | ||||||
|  |       "@type": "ImageObject", | ||||||
|  |       "url": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }} | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | {{- end }}{{/* .IsPage end */}} | ||||||
|  |  | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										31
									
								
								layouts/layouts/partials/templates/twitter_cards.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								layouts/layouts/partials/templates/twitter_cards.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | |||||||
|  | {{- if .Params.cover.image -}} | ||||||
|  | <meta name="twitter:card" content="summary_large_image"> | ||||||
|  | {{- if (ne $.Params.cover.relative true) }} | ||||||
|  | <meta name="twitter:image" content="{{ .Params.cover.image | absURL }}"> | ||||||
|  | {{- else }} | ||||||
|  | <meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}"> | ||||||
|  | {{- end}} | ||||||
|  | {{- else }} | ||||||
|  | {{- $images := partial "templates/_funcs/get-page-images" . -}} | ||||||
|  | {{- with index $images 0 -}} | ||||||
|  | <meta name="twitter:card" content="summary_large_image"> | ||||||
|  | <meta name="twitter:image" content="{{ .Permalink }}"> | ||||||
|  | {{- else -}} | ||||||
|  | <meta name="twitter:card" content="summary"> | ||||||
|  | {{- end -}} | ||||||
|  | {{- end }} | ||||||
|  | <meta name="twitter:title" content="{{ .Title }}"> | ||||||
|  | <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"> | ||||||
|  |  | ||||||
|  | {{- $twitterSite := "" }} | ||||||
|  | {{- with site.Params.social }} | ||||||
|  |   {{- if reflect.IsMap . }} | ||||||
|  |     {{- with .twitter }} | ||||||
|  |       {{- $content := . }} | ||||||
|  |       {{- if not (strings.HasPrefix . "@") }} | ||||||
|  |         {{- $content = printf "@%v" . }} | ||||||
|  |       {{- end }} | ||||||
|  |       <meta name="twitter:site" content="{{ $content }}"> | ||||||
|  |     {{- end }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										97
									
								
								layouts/layouts/partials/toc.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								layouts/layouts/partials/toc.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,97 @@ | |||||||
|  | {{- $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content -}} | ||||||
|  | {{- $has_headers := ge (len $headers) 1 -}} | ||||||
|  | {{- if $has_headers -}} | ||||||
|  | <div class="toc"> | ||||||
|  |     <details {{if (.Param "TocOpen") }} open{{ end }}> | ||||||
|  |         <summary accesskey="c" title="(Alt + C)"> | ||||||
|  |             <span class="details">{{- i18n "toc" | default "Table of Contents" }}</span> | ||||||
|  |         </summary> | ||||||
|  |  | ||||||
|  |         <div class="inner"> | ||||||
|  |             {{- if (.Param "UseHugoToc") }} | ||||||
|  |             {{- .TableOfContents -}} | ||||||
|  |             {{- else }} | ||||||
|  |             {{- $largest := 6 -}} | ||||||
|  |             {{- range $headers -}} | ||||||
|  |             {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} | ||||||
|  |             {{- $headerLevel := len (seq $headerLevel) -}} | ||||||
|  |             {{- if lt $headerLevel $largest -}} | ||||||
|  |             {{- $largest = $headerLevel -}} | ||||||
|  |             {{- end -}} | ||||||
|  |             {{- end -}} | ||||||
|  |  | ||||||
|  |             {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} | ||||||
|  |  | ||||||
|  |             {{- $.Scratch.Set "bareul" slice -}} | ||||||
|  |             <ul> | ||||||
|  |                 {{- range seq (sub $firstHeaderLevel $largest) -}} | ||||||
|  |                 <ul> | ||||||
|  |                     {{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}} | ||||||
|  |                     {{- end -}} | ||||||
|  |                     {{- range $i, $header := $headers -}} | ||||||
|  |                     {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} | ||||||
|  |                     {{- $headerLevel := len (seq $headerLevel) -}} | ||||||
|  |  | ||||||
|  |                     {{/* get id="xyz" */}} | ||||||
|  |                     {{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }} | ||||||
|  |  | ||||||
|  |                     {{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}} | ||||||
|  |                     {{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }} | ||||||
|  |                     {{- $header := replaceRE "<h[1-6].*?>((.|\n])+?)</h[1-6]>" "$1" $header -}} | ||||||
|  |  | ||||||
|  |                     {{- if ne $i 0 -}} | ||||||
|  |                     {{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}} | ||||||
|  |                     {{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}} | ||||||
|  |                     {{- if gt $headerLevel $prevHeaderLevel -}} | ||||||
|  |                     {{- range seq $prevHeaderLevel (sub $headerLevel 1) -}} | ||||||
|  |                     <ul> | ||||||
|  |                         {{/* the first should not be recorded */}} | ||||||
|  |                         {{- if ne $prevHeaderLevel . -}} | ||||||
|  |                         {{- $.Scratch.Add "bareul" . -}} | ||||||
|  |                         {{- end -}} | ||||||
|  |                         {{- end -}} | ||||||
|  |                         {{- else -}} | ||||||
|  |                         </li> | ||||||
|  |                         {{- if lt $headerLevel $prevHeaderLevel -}} | ||||||
|  |                         {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}} | ||||||
|  |                         {{- if in ($.Scratch.Get "bareul") . -}} | ||||||
|  |                     </ul> | ||||||
|  |                     {{/* manually do pop item */}} | ||||||
|  |                     {{- $tmp := $.Scratch.Get "bareul" -}} | ||||||
|  |                     {{- $.Scratch.Delete "bareul" -}} | ||||||
|  |                     {{- $.Scratch.Set "bareul" slice}} | ||||||
|  |                     {{- range seq (sub (len $tmp) 1) -}} | ||||||
|  |                     {{- $.Scratch.Add "bareul" (index $tmp (sub . 1)) -}} | ||||||
|  |                     {{- end -}} | ||||||
|  |                     {{- else -}} | ||||||
|  |                 </ul> | ||||||
|  |                 </li> | ||||||
|  |                 {{- end -}} | ||||||
|  |                 {{- end -}} | ||||||
|  |                 {{- end -}} | ||||||
|  |                 {{- end }} | ||||||
|  |                 <li> | ||||||
|  |                     <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify | safeHTML -}}">{{- $header | plainify | safeHTML -}}</a> | ||||||
|  |                     {{- else }} | ||||||
|  |                 <li> | ||||||
|  |                     <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify | safeHTML -}}">{{- $header | plainify | safeHTML -}}</a> | ||||||
|  |                     {{- end -}} | ||||||
|  |                     {{- end -}} | ||||||
|  |                     <!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} --> | ||||||
|  |                     {{- $firstHeaderLevel := $largest }} | ||||||
|  |                     {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) }} | ||||||
|  |                 </li> | ||||||
|  |                 {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}} | ||||||
|  |                 {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) }} | ||||||
|  |             </ul> | ||||||
|  |             {{- else }} | ||||||
|  |             </ul> | ||||||
|  |             </li> | ||||||
|  |             {{- end -}} | ||||||
|  |             {{- end }} | ||||||
|  |             </ul> | ||||||
|  |             {{- end }} | ||||||
|  |         </div> | ||||||
|  |     </details> | ||||||
|  | </div> | ||||||
|  | {{- end }} | ||||||
							
								
								
									
										19
									
								
								layouts/layouts/partials/translation_list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								layouts/layouts/partials/translation_list.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | {{- if .IsTranslated -}} | ||||||
|  | {{- if (ne .Layout "search") }} | ||||||
|  | {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}} | ||||||
|  | {{- end }} | ||||||
|  | {{- i18n "translations" | default "Translations" }}: | ||||||
|  | <ul class="i18n_list"> | ||||||
|  |     {{- range .Translations }} | ||||||
|  |     <li> | ||||||
|  |         <a href="{{ .Permalink }}"> | ||||||
|  |             {{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }} | ||||||
|  |             {{- .Language.LanguageName | emojify -}} | ||||||
|  |             {{- else }} | ||||||
|  |             {{- .Lang | title -}} | ||||||
|  |             {{- end -}} | ||||||
|  |         </a> | ||||||
|  |     </li> | ||||||
|  |     {{- end }} | ||||||
|  | </ul> | ||||||
|  | {{- end -}} | ||||||
							
								
								
									
										7
									
								
								layouts/layouts/robots.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								layouts/layouts/robots.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | User-agent: * | ||||||
|  | {{- if hugo.IsProduction | or (eq site.Params.env "production") }} | ||||||
|  | Disallow: | ||||||
|  | {{- else }} | ||||||
|  | Disallow: / | ||||||
|  | {{- end }} | ||||||
|  | Sitemap: {{ "sitemap.xml" | absURL }} | ||||||
							
								
								
									
										8
									
								
								layouts/layouts/shortcodes/collapse.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								layouts/layouts/shortcodes/collapse.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | {{ if .Get "summary" }} | ||||||
|  | {{ else }} | ||||||
|  | {{ warnf "missing value for param 'summary': %s" .Position }} | ||||||
|  | {{ end }} | ||||||
|  | <p><details {{ if (eq (.Get "openByDefault") true) }} open=true {{ end }}> | ||||||
|  |   <summary markdown="span">{{ .Get "summary" | markdownify }}</summary> | ||||||
|  |   {{ .Inner | markdownify }} | ||||||
|  | </details></p> | ||||||
							
								
								
									
										31
									
								
								layouts/layouts/shortcodes/figure.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								layouts/layouts/shortcodes/figure.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | |||||||
|  | <figure{{ if or (.Get "class") (eq (.Get "align") "center") }} class=" | ||||||
|  |            {{- if eq (.Get "align") "center" }}align-center {{ end }} | ||||||
|  |            {{- with .Get "class" }}{{ . }}{{- end }}" | ||||||
|  | {{- end -}}> | ||||||
|  |     {{- if .Get "link" -}} | ||||||
|  |         <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}> | ||||||
|  |     {{- end }} | ||||||
|  |     <img loading="lazy" src="{{ .Get "src" }}{{- if eq (.Get "align") "center" }}#center{{- end }}" | ||||||
|  |          {{- if or (.Get "alt") (.Get "caption") }} | ||||||
|  |          alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" | ||||||
|  |          {{- end -}} | ||||||
|  |          {{- with .Get "width" }} width="{{ . }}"{{ end -}} | ||||||
|  |          {{- with .Get "height" }} height="{{ . }}"{{ end -}} | ||||||
|  |     /> <!-- Closing img tag --> | ||||||
|  |     {{- if .Get "link" }}</a>{{ end -}} | ||||||
|  |     {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} | ||||||
|  |         <figcaption> | ||||||
|  |             {{ with (.Get "title") -}} | ||||||
|  |                 {{ . }} | ||||||
|  |             {{- end -}} | ||||||
|  |             {{- if or (.Get "caption") (.Get "attr") -}}<p> | ||||||
|  |                 {{- .Get "caption" | markdownify -}} | ||||||
|  |                 {{- with .Get "attrlink" }} | ||||||
|  |                     <a href="{{ . }}"> | ||||||
|  |                 {{- end -}} | ||||||
|  |                 {{- .Get "attr" | markdownify -}} | ||||||
|  |                 {{- if .Get "attrlink" }}</a>{{ end }}</p> | ||||||
|  |             {{- end }} | ||||||
|  |         </figcaption> | ||||||
|  |     {{- end }} | ||||||
|  | </figure> | ||||||
							
								
								
									
										5
									
								
								layouts/layouts/shortcodes/inTextImg.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								layouts/layouts/shortcodes/inTextImg.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | {{- $Img := (.Get "url") }} | ||||||
|  | {{- $height := (.Get "height") }} | ||||||
|  | {{- $alt := (.Get "alt") }} | ||||||
|  |  | ||||||
|  | <img class="in-text" height="{{ $height | default `15` }}" src="{{$Img}}" alt="{{$alt}}"> | ||||||
							
								
								
									
										15
									
								
								layouts/layouts/shortcodes/ltr.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								layouts/layouts/shortcodes/ltr.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | {{ $.Scratch.Set "md" false }} | ||||||
|  |  | ||||||
|  | {{ if .IsNamedParams }} | ||||||
|  | {{ $.Scratch.Set "md" (.Get "md") }} | ||||||
|  | {{ else }} | ||||||
|  | {{ $.Scratch.Set "md" (.Get 0) }} | ||||||
|  | {{ end }} | ||||||
|  |  | ||||||
|  | <div dir="ltr"> | ||||||
|  |   {{ if eq ($.Scratch.Get "md") false }} | ||||||
|  |     {{ .Inner }} | ||||||
|  |   {{ else }} | ||||||
|  |     {{ .Inner | markdownify }} | ||||||
|  |   {{ end }} | ||||||
|  | </div> | ||||||
							
								
								
									
										2
									
								
								layouts/layouts/shortcodes/rawhtml.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								layouts/layouts/shortcodes/rawhtml.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | |||||||
|  | <!-- raw html --> | ||||||
|  | {{- .Inner -}} | ||||||
							
								
								
									
										15
									
								
								layouts/layouts/shortcodes/rtl.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								layouts/layouts/shortcodes/rtl.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | {{ $.Scratch.Set "md" false }} | ||||||
|  |  | ||||||
|  | {{ if .IsNamedParams }} | ||||||
|  | {{ $.Scratch.Set "md" (.Get "md") }} | ||||||
|  | {{ else }} | ||||||
|  | {{ $.Scratch.Set "md" (.Get 0) }} | ||||||
|  | {{ end }} | ||||||
|  |  | ||||||
|  | <div dir="rtl"> | ||||||
|  |   {{ if eq ($.Scratch.Get "md") false }} | ||||||
|  |     {{ .Inner }} | ||||||
|  |   {{ else }} | ||||||
|  |     {{ .Inner | markdownify }} | ||||||
|  |   {{ end }} | ||||||
|  | </div> | ||||||
| @@ -50,14 +50,14 @@ | |||||||
| {{ end }}{{ end }} | {{ end }}{{ end }} | ||||||
| {{- end }} | {{- end }} | ||||||
|  |  | ||||||
| {{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} | {{- /* Deprecate site.Params.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} | ||||||
| {{- $facebookAdmin := "" }} | {{- $facebookAdmin := "" }} | ||||||
| {{- with site.Params.social }} | {{- with site.Params.social }} | ||||||
|   {{- if reflect.IsMap . }} |   {{- if reflect.IsMap . }} | ||||||
|     {{- $facebookAdmin = .facebook_admin }} |     {{- $facebookAdmin = .facebook_admin }} | ||||||
|   {{- end }} |   {{- end }} | ||||||
| {{- else }} | {{- else }} | ||||||
|   {{- with site.Social.facebook_admin }} |   {{- with site.Params.Social.facebook_admin }} | ||||||
|     {{- $facebookAdmin = . }} |     {{- $facebookAdmin = . }} | ||||||
|     {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} |     {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} | ||||||
|   {{- end }} |   {{- end }} | ||||||
|   | |||||||
| @@ -28,14 +28,14 @@ | |||||||
| {{- end }} | {{- end }} | ||||||
| <meta name="twitter:title" content="{{ .Title }}"/> | <meta name="twitter:title" content="{{ .Title }}"/> | ||||||
| <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> | <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> | ||||||
| {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} | {{- /* Deprecate site.Params.Social.twitter in favor of site.Params.social.twitter */}} | ||||||
| {{- $twitterSite := "" }} | {{- $twitterSite := "" }} | ||||||
| {{- with site.Params.social }} | {{- with site.Params.social }} | ||||||
|   {{- if reflect.IsMap . }} |   {{- if reflect.IsMap . }} | ||||||
|     {{- $twitterSite = .twitter }} |     {{- $twitterSite = .twitter }} | ||||||
|   {{- end }} |   {{- end }} | ||||||
| {{- else }} | {{- else }} | ||||||
|   {{- with site.Social.twitter }} |   {{- with site.Params.Social.twitter }} | ||||||
|     {{- $twitterSite = . }} |     {{- $twitterSite = . }} | ||||||
|     {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} |     {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} | ||||||
|   {{- end }} |   {{- end }} | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								resources/_gen/images/images/blackwolf_hu_b1f5413bfccaa29e.webp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/_gen/images/images/blackwolf_hu_b1f5413bfccaa29e.webp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 346 B | 
		Reference in New Issue
	
	Block a user