├── go.mod ├── layouts ├── shortcodes │ ├── rawhtml.html │ ├── inTextImg.html │ ├── youtube.html │ ├── collapse.html │ ├── ltr.html │ ├── rtl.html │ └── figure.html ├── 404.html ├── _default │ ├── _markup │ │ └── render-image.html │ ├── index.json │ ├── terms.html │ ├── baseof.html │ ├── search.html │ ├── single.html │ ├── archives.html │ ├── rss.xml │ └── list.html ├── partials │ ├── comments.html │ ├── extend_footer.html │ ├── anchored_headings.html │ ├── post_lastmod.html │ ├── extend_head.html │ ├── social_icons.html │ ├── author.html │ ├── home_info.html │ ├── post_nav_links.html │ ├── post_canonical.html │ ├── edit_post.html │ ├── translation_list.html │ ├── breadcrumbs.html │ ├── post_meta.html │ ├── footer.html │ ├── script.html │ ├── templates │ │ ├── twitter_cards.html │ │ ├── opengraph.html │ │ └── schema_json.html │ ├── cover.html │ ├── index_profile.html │ ├── toc.html │ ├── head.html │ ├── header.html │ └── share_icons.html └── robots.txt ├── images ├── tn.png └── screenshot.png ├── .github ├── assets │ └── web-capture.jpeg ├── ISSUE_TEMPLATE │ ├── new-blank-issue.md │ ├── config.yml │ └── bug_report.md ├── stale.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── gh-pages.yml ├── assets ├── css │ ├── includes │ │ ├── noscript.css │ │ └── scroll-bar.css │ ├── core │ │ ├── license.css │ │ ├── theme-vars.css │ │ ├── zmedia.css │ │ └── reset.css │ ├── common │ │ ├── 404.css │ │ ├── terms.css │ │ ├── archive.css │ │ ├── profile-mode.css │ │ ├── search.css │ │ ├── footer.css │ │ ├── main.css │ │ ├── post-entry.css │ │ ├── header.css │ │ ├── chroma.css │ │ └── post-single.css │ └── extended │ │ ├── blank.css │ │ └── youtube.css └── js │ ├── license.js │ ├── theme.js │ ├── papermod.js │ ├── fastsearch.js │ └── fuse.basic.min.js ├── Makefile ├── i18n ├── bg.yaml ├── hu.yaml ├── hi.yaml ├── ca.yaml ├── uz.yaml ├── mn.yaml ├── eo.yaml ├── uk.yaml ├── ku.yaml ├── ckb.yaml ├── fa.yaml ├── da.yaml ├── sv.yaml ├── ms.yaml ├── ar.yaml ├── ja.yaml ├── zh.yaml ├── ko.yaml ├── he.yaml ├── zh-tw.yaml ├── th.yaml ├── cs.yaml ├── en.yaml ├── id.yaml ├── ro.yaml ├── tr.yaml ├── fr.yaml ├── no.yaml ├── sw.yaml ├── vi.yaml ├── it.yaml ├── nl.yaml ├── pl.yaml ├── bn.yaml ├── de.yaml ├── el.yaml ├── es.yaml ├── pt.yaml ├── hr.yaml ├── ru.yaml └── be.yaml ├── LICENSE ├── theme.toml └── README.md /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Wonderfall/hugo-WonderMod 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /layouts/shortcodes/rawhtml.html: -------------------------------------------------------------------------------- 1 | 2 | {{- .Inner -}} 3 | -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wonderfall/hugo-WonderMod/HEAD/images/tn.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wonderfall/hugo-WonderMod/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 |
404
3 | {{- end }}{{/* end main */ -}} 4 | -------------------------------------------------------------------------------- /.github/assets/web-capture.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wonderfall/hugo-WonderMod/HEAD/.github/assets/web-capture.jpeg -------------------------------------------------------------------------------- /assets/css/includes/noscript.css: -------------------------------------------------------------------------------- 1 | #theme-toggle, 2 | .top-link { 3 | display: none; 4 | } 5 | 6 | #searchInput { 7 | display: none; 8 | } -------------------------------------------------------------------------------- /layouts/_default/_markup/render-image.html: -------------------------------------------------------------------------------- 1 | {{ .Text }} 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-blank-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New Blank Issue 3 | about: Anything other than bug report 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | run-example: 2 | cd exampleSite && hugo server -D --gc -p 13131 3 | 4 | chroma-css: 5 | hugo gen chromastyles --style=dracula > assets/css/common/chroma.css 6 | -------------------------------------------------------------------------------- /layouts/partials/comments.html: -------------------------------------------------------------------------------- 1 | {{- /* Comments area start */ -}} 2 | {{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}} 3 | {{- /* Comments area end */ -}} 4 | -------------------------------------------------------------------------------- /layouts/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | {{- if hugo.IsProduction | or (eq site.Params.env "production") }} 3 | Disallow: 4 | {{- else }} 5 | Disallow: / 6 | {{- end }} 7 | Sitemap: {{ "sitemap.xml" | absURL }} 8 | -------------------------------------------------------------------------------- /layouts/partials/extend_footer.html: -------------------------------------------------------------------------------- 1 | {{- /* Footer custom content area start */ -}} 2 | {{- /* Insert any custom code web-analytics, resources, etc. here */ -}} 3 | {{- /* Footer custom content area end */ -}} 4 | -------------------------------------------------------------------------------- /assets/js/license.js: -------------------------------------------------------------------------------- 1 | /* 2 | PaperMod v7 3 | License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE 4 | Copyright (c) 2020 nanxiaobei and adityatelange 5 | Copyright (c) 2021-2023 adityatelange 6 | */ 7 | -------------------------------------------------------------------------------- /layouts/shortcodes/inTextImg.html: -------------------------------------------------------------------------------- 1 | {{- $Img := (.Get "url") }} 2 | {{- $height := (.Get "height") }} 3 | {{- $alt := (.Get "alt") }} 4 | 5 | {{$alt}} 6 | -------------------------------------------------------------------------------- /assets/css/core/license.css: -------------------------------------------------------------------------------- 1 | /* 2 | PaperMod v7 3 | License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE 4 | Copyright (c) 2020 nanxiaobei and adityatelange 5 | Copyright (c) 2021-2023 adityatelange 6 | */ 7 | -------------------------------------------------------------------------------- /layouts/partials/anchored_headings.html: -------------------------------------------------------------------------------- 1 | {{- /* formats .Content headings by adding an anchor */ -}} 2 | {{ . | replaceRE "()" "${1}${3}" | safeHTML }} 3 | -------------------------------------------------------------------------------- /layouts/shortcodes/youtube.html: -------------------------------------------------------------------------------- 1 | {{- $id := .Get "id" | default (.Get 0) -}} 2 |
3 | 4 |
-------------------------------------------------------------------------------- /assets/css/common/404.css: -------------------------------------------------------------------------------- 1 | .not-found { 2 | position: absolute; 3 | left: 0; 4 | right: 0; 5 | display: flex; 6 | align-items: center; 7 | justify-content: center; 8 | height: 80%; 9 | font-size: 160px; 10 | font-weight: 700; 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: PaperMod Discussions 4 | url: https://github.com/adityatelange/hugo-PaperMod/discussions 5 | about: Please ask and answer questions/doubts here, do not open an issue for questions. 6 | -------------------------------------------------------------------------------- /assets/css/extended/blank.css: -------------------------------------------------------------------------------- 1 | /* 2 | This is just a placeholder blank stylesheet so as to support adding custom styles budled with theme's default styles 3 | 4 | Read https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#bundling-custom-css-with-themes-assets for more info 5 | */ 6 | -------------------------------------------------------------------------------- /layouts/partials/post_lastmod.html: -------------------------------------------------------------------------------- 1 | {{ $date := .Date.Format "02.01.2006" }} 2 | {{ $lastmod := .Lastmod.Format "02.01.2006" }} 3 | 4 | {{- if ne $lastmod $date -}} 5 | Last updated on {{ .Lastmod | time.Format (default "January 2, 2006" site.Params.DateFormat) }} 6 | {{- end }} -------------------------------------------------------------------------------- /i18n/bg.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Предишна страница" 3 | 4 | - id: next_page 5 | translation: "Следваща страница" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 мин" 10 | other: "{{ .Count }} мин" 11 | 12 | - id: toc 13 | translation: "Съдържание" 14 | 15 | - id: translations 16 | translation: "Преводи" 17 | -------------------------------------------------------------------------------- /i18n/hu.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Előző oldal" 3 | 4 | - id: next_page 5 | translation: "Következő oldal" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 perc" 10 | other: "{{ .Count }} perc" 11 | 12 | - id: toc 13 | translation: "Tartalomjegyzék" 14 | 15 | - id: translations 16 | translation: "Fordítások" 17 | -------------------------------------------------------------------------------- /layouts/partials/extend_head.html: -------------------------------------------------------------------------------- 1 | {{- /* Head custom content area start */ -}} 2 | {{- /* Insert any custom code (web-analytics, resources, etc.) - it will appear in the section of every page. */ -}} 3 | {{- /* Can be overwritten by partial with the same name in the global layouts. */ -}} 4 | {{- /* Head custom content area end */ -}} 5 | -------------------------------------------------------------------------------- /layouts/shortcodes/collapse.html: -------------------------------------------------------------------------------- 1 | {{ if .Get "summary" }} 2 | {{ else }} 3 | {{ warnf "missing value for param 'summary': %s" .Position }} 4 | {{ end }} 5 |

6 | {{ .Get "summary" | markdownify }} 7 | {{ .Inner | markdownify }} 8 |

9 | -------------------------------------------------------------------------------- /assets/css/extended/youtube.css: -------------------------------------------------------------------------------- 1 | .youtube-embed-div { 2 | position: relative; 3 | padding-bottom: 56.25%; 4 | margin-bottom: 20px; 5 | height: 0; 6 | overflow: hidden; 7 | } 8 | 9 | .youtube-embed-frame { 10 | position: absolute; 11 | top: 0; 12 | left: 0; 13 | width: 100%; 14 | height: 100%; 15 | border: 0; 16 | } -------------------------------------------------------------------------------- /layouts/partials/social_icons.html: -------------------------------------------------------------------------------- 1 |
2 | {{- range site.Params.socialIcons }} 3 | 5 | {{ partial "svg.html" . }} 6 | 7 | {{- end }} 8 |
9 | -------------------------------------------------------------------------------- /layouts/partials/author.html: -------------------------------------------------------------------------------- 1 | {{- if or .Params.author site.Params.author }} 2 | {{- $author := (.Params.author | default site.Params.author) }} 3 | {{- $author_type := (printf "%T" $author) }} 4 | {{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }} 5 | {{- (delimit $author ", " ) }} 6 | {{- else }} 7 | {{- $author }} 8 | {{- end }} 9 | {{- end -}} 10 | -------------------------------------------------------------------------------- /layouts/shortcodes/ltr.html: -------------------------------------------------------------------------------- 1 | {{ $.Scratch.Set "md" false }} 2 | 3 | {{ if .IsNamedParams }} 4 | {{ $.Scratch.Set "md" (.Get "md") }} 5 | {{ else }} 6 | {{ $.Scratch.Set "md" (.Get 0) }} 7 | {{ end }} 8 | 9 |
10 | {{ if eq ($.Scratch.Get "md") false }} 11 | {{ .Inner }} 12 | {{ else }} 13 | {{ .Inner | markdownify }} 14 | {{ end }} 15 |
16 | -------------------------------------------------------------------------------- /layouts/shortcodes/rtl.html: -------------------------------------------------------------------------------- 1 | {{ $.Scratch.Set "md" false }} 2 | 3 | {{ if .IsNamedParams }} 4 | {{ $.Scratch.Set "md" (.Get "md") }} 5 | {{ else }} 6 | {{ $.Scratch.Set "md" (.Get 0) }} 7 | {{ end }} 8 | 9 |
10 | {{ if eq ($.Scratch.Get "md") false }} 11 | {{ .Inner }} 12 | {{ else }} 13 | {{ .Inner | markdownify }} 14 | {{ end }} 15 |
16 | -------------------------------------------------------------------------------- /i18n/hi.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "पिछला" 3 | 4 | - id: next_page 5 | translation: "अगला" 6 | 7 | - id: read_time 8 | translation: 9 | one : "एक मिनट" 10 | other: "{{ .Count }} मिनट" 11 | 12 | - id: edit_post 13 | translation: "सुधारें" 14 | 15 | - id: toc 16 | translation: "विषय - सूची" 17 | 18 | - id: translations 19 | translation: "अनुवाद" 20 | -------------------------------------------------------------------------------- /layouts/_default/index.json: -------------------------------------------------------------------------------- 1 | {{- $.Scratch.Add "index" slice -}} 2 | {{- range site.RegularPages -}} 3 | {{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }} 4 | {{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}} 5 | {{- end }} 6 | {{- end -}} 7 | {{- $.Scratch.Get "index" | jsonify -}} 8 | -------------------------------------------------------------------------------- /i18n/ca.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Pàgina anterior" 3 | 4 | - id: next_page 5 | translation: "Pàgina següent" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: toc 13 | translation: "Taula de Continguts" 14 | 15 | - id: translations 16 | translation: "Traduccions" 17 | 18 | - id: home 19 | translation: "Inici" 20 | -------------------------------------------------------------------------------- /assets/css/common/terms.css: -------------------------------------------------------------------------------- 1 | .terms-tags li { 2 | display: inline-block; 3 | margin: 10px; 4 | font-weight: 500; 5 | } 6 | 7 | .terms-tags a { 8 | display: block; 9 | padding: 3px 10px; 10 | background: var(--tertiary); 11 | border-radius: 6px; 12 | transition: transform 0.1s; 13 | } 14 | 15 | .terms-tags a:active { 16 | background: var(--tertiary); 17 | transform: scale(0.96); 18 | } 19 | -------------------------------------------------------------------------------- /i18n/uz.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Oldingi sahifa" 3 | 4 | - id: next_page 5 | translation: "Keyingi sahifa" 6 | 7 | - id: read_time 8 | translation: 9 | one : "Bir daqiqa" 10 | other: "{{ .Count }} daqiqa" 11 | 12 | - id: toc 13 | translation: "Mundarija" 14 | 15 | - id: translations 16 | translation: "Tarjimalar" 17 | 18 | - id: home 19 | translation: "Bosh sahifa" 20 | 21 | -------------------------------------------------------------------------------- /assets/js/theme.js: -------------------------------------------------------------------------------- 1 | function loadPreferredTheme() { 2 | const preferredTheme = localStorage.getItem("pref-theme"); 3 | const isDarkTheme = document.body.classList.contains("dark"); 4 | 5 | if (preferredTheme === "light" && isDarkTheme) { 6 | document.body.classList.remove('dark') 7 | } else if (preferredTheme === "dark" && !isDarkTheme) { 8 | document.body.classList.add('dark') 9 | } 10 | } 11 | 12 | loadPreferredTheme(); -------------------------------------------------------------------------------- /i18n/mn.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Ѳмнѳх" 3 | 4 | - id: next_page 5 | translation: "Дараах" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 МИН" 10 | other: "{{ .Count }} МИН" 11 | 12 | - id: toc 13 | translation: "Агуулга" 14 | 15 | - id: translations 16 | translation: "Орчуулга" 17 | 18 | - id: home 19 | translation: "Нүүр" 20 | 21 | - id: code_copy 22 | translation: "хуулах" 23 | 24 | - id: code_copied 25 | translation: "хуулсан!" 26 | -------------------------------------------------------------------------------- /i18n/eo.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "antaŭa paĝo" 3 | 4 | - id: next_page 5 | translation: "sekva paĝo" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: toc 13 | translation: "Enhavo" 14 | 15 | - id: translations 16 | translation: "tradukoj" 17 | 18 | - id: home 19 | translation: "ĉefpaĝo" 20 | 21 | - id: code_copy 22 | translation: "kopii" 23 | 24 | - id: code_copied 25 | translation: "kopiite!" 26 | -------------------------------------------------------------------------------- /i18n/uk.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Попередня" 3 | 4 | - id: next_page 5 | translation: "Наступна" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 хвилина" 10 | other: "{{ .Count }} хвилин" 11 | 12 | - id: toc 13 | translation: "Зміст" 14 | 15 | - id: translations 16 | translation: "Переклади" 17 | 18 | - id: home 19 | translation: "Головна" 20 | 21 | - id: code_copy 22 | translation: "копіювати" 23 | 24 | - id: code_copied 25 | translation: "скопійовано!" -------------------------------------------------------------------------------- /i18n/ku.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Rûpela Paş" 3 | 4 | - id: next_page 5 | translation: "Rûpela Pêş" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 xulek" 10 | other: "{{ .Count }} xulek" 11 | 12 | - id: toc 13 | translation: "Pêrist" 14 | 15 | - id: translations 16 | translation: "Wergeran" 17 | 18 | - id: home 19 | translation: "Xanî" 20 | 21 | - id: code_copy 22 | translation: "Jê bigire" 23 | 24 | - id: code_copied 25 | translation: "Hat jêgirtin!" 26 | -------------------------------------------------------------------------------- /layouts/partials/home_info.html: -------------------------------------------------------------------------------- 1 | {{- with site.Params.homeInfoParams }} 2 |
3 |
4 |

{{ .Title | markdownify }}

5 |
6 |
7 | {{ .Content | markdownify }} 8 |
9 |
10 | {{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }} 11 |
12 |
13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /i18n/ckb.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "پەڕەی پێشتر" 3 | 4 | - id: next_page 5 | translation: "پەڕەی دواتر" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 خولەک" 10 | other: "{{ .Count }} خولەک" 11 | 12 | - id: toc 13 | translation: "پێڕست" 14 | 15 | - id: translations 16 | translation: "وەرگێڕانەکان" 17 | 18 | - id: home 19 | translation: "ماڵەوە" 20 | 21 | - id: code_copy 22 | translation: "لەبەری بگرەوە" 23 | 24 | - id: code_copied 25 | translation: "لەبەر گیرایەوە!" 26 | -------------------------------------------------------------------------------- /i18n/fa.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "صفحه قبلی" 3 | 4 | - id: next_page 5 | translation: "صفحه بعدی" 6 | 7 | - id: read_time 8 | translation: 9 | one: "۱ دقیقه" 10 | other: "{{ .Count }} دقیقه" 11 | 12 | - id: toc 13 | translation: "فهرست مطالب" 14 | 15 | - id: translations 16 | translation: "ترجمه ها" 17 | 18 | - id: home 19 | translation: "خانه" 20 | 21 | - id: edit_post 22 | translation: "ویرایش" 23 | 24 | - id: code_copy 25 | translation: "کپی" 26 | 27 | - id: code_copied 28 | translation: "کپی شد!" -------------------------------------------------------------------------------- /i18n/da.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Forrige Side" 3 | 4 | - id: next_page 5 | translation: "Næste Side" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: toc 13 | translation: "Indholdsfortegnelse" 14 | 15 | - id: translations 16 | translation: "Oversættelser" 17 | 18 | - id: home 19 | translation: "Start" 20 | 21 | - id: edit_post 22 | translation: "Rediger" 23 | 24 | - id: code_copy 25 | translation: "kopier" 26 | 27 | - id: code_copied 28 | translation: "kopieret!" 29 | -------------------------------------------------------------------------------- /i18n/sv.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Förra Sidan" 3 | 4 | - id: next_page 5 | translation: "Nästa Sida" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: toc 13 | translation: "Innehållsförteckning" 14 | 15 | - id: translations 16 | translation: "Översättningar" 17 | 18 | - id: home 19 | translation: "Hem" 20 | 21 | - id: edit_post 22 | translation: "Redigera" 23 | 24 | - id: code_copy 25 | translation: "kopiera" 26 | 27 | - id: code_copied 28 | translation: "kopierad!" 29 | -------------------------------------------------------------------------------- /i18n/ms.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Halaman Sebelumnya" 3 | 4 | - id: next_page 5 | translation: "Halaman Seterusnya" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 minit" 10 | other: "{{ .Count }} minit" 11 | 12 | - id: toc 13 | translation: "Isi Kandungan" 14 | 15 | - id: translations 16 | translation: "Terjemahan" 17 | 18 | - id: home 19 | translation: "Home" 20 | 21 | - id: edit_post 22 | translation: "Sunting" 23 | 24 | - id: code_copy 25 | translation: "Salin" 26 | 27 | - id: code_copied 28 | translation: "Disalin!" 29 | -------------------------------------------------------------------------------- /i18n/ar.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "السابق" 3 | 4 | - id: next_page 5 | translation: "التالي" 6 | 7 | - id: read_time 8 | translation: 9 | one: "دقيقة واحدة" 10 | two: "دقيقتان" 11 | few: "بضع ثوان" 12 | zero: "الآن" 13 | other: "دقائق {{ .Count }}" 14 | 15 | - id: toc 16 | translation: "فهرس المحتوى" 17 | 18 | - id: translations 19 | translation: "ترجمات أخرى" 20 | 21 | - id: home 22 | translation: "الصفحة الرئيسية" 23 | 24 | - id: code_copied 25 | translation: "تم النسخ!" 26 | 27 | - id: code_copy 28 | translation: "نسخ الكود" 29 | -------------------------------------------------------------------------------- /i18n/ja.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "前へ" 3 | 4 | - id: next_page 5 | translation: "次へ" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 分" 10 | other: "{{ .Count }} 分" 11 | 12 | - id: words 13 | translation: 14 | one: "文字" 15 | other: "{{ .Count }} 文字" 16 | 17 | - id: toc 18 | translation: "目次" 19 | 20 | - id: translations 21 | translation: "言語" 22 | 23 | - id: home 24 | translation: "ホーム" 25 | 26 | - id: edit_post 27 | translation: "編集" 28 | 29 | - id: code_copy 30 | translation: "コピー" 31 | 32 | - id: code_copied 33 | translation: "コピーされました!" 34 | -------------------------------------------------------------------------------- /i18n/zh.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "上一页" 3 | 4 | - id: next_page 5 | translation: "下一页" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 分钟" 10 | other: "{{ .Count }} 分钟" 11 | 12 | - id: words 13 | translation: 14 | one: "字" 15 | other: "{{ .Count }} 字" 16 | 17 | - id: toc 18 | translation: "目录" 19 | 20 | - id: translations 21 | translation: "语言" 22 | 23 | - id: home 24 | translation: "主页" 25 | 26 | - id: edit_post 27 | translation: "编辑" 28 | 29 | - id: code_copy 30 | translation: "复制" 31 | 32 | - id: code_copied 33 | translation: "已复制!" 34 | -------------------------------------------------------------------------------- /i18n/ko.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "이전 페이지" 3 | 4 | - id: next_page 5 | translation: "다음 페이지" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 분" 10 | other: "{{ .Count }} 분" 11 | 12 | - id: words 13 | translation: 14 | one : "단어" 15 | other: "{{ .Count }} 단어" 16 | 17 | - id: toc 18 | translation: "목차" 19 | 20 | - id: translations 21 | translation: "번역" 22 | 23 | - id: home 24 | translation: "홈" 25 | 26 | - id: edit_post 27 | translation: "편집" 28 | 29 | - id: code_copy 30 | translation: "복사" 31 | 32 | - id: code_copied 33 | translation: "복사 완료!" 34 | -------------------------------------------------------------------------------- /layouts/partials/post_nav_links.html: -------------------------------------------------------------------------------- 1 | {{- $pages := .CurrentSection.RegularPages.ByTitle }} 2 | {{- if and (gt (len $pages) 1) (in $pages . ) }} 3 | 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /i18n/he.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "קודם" 3 | 4 | - id: next_page 5 | translation: "הבא" 6 | 7 | - id: read_time 8 | translation: 9 | one : "דקה אחת" 10 | other: "דקות {{ .Count }}" 11 | 12 | - id: words 13 | translation: 14 | one : "word" 15 | other: "מילים {{ .Count }} " 16 | 17 | - id: toc 18 | translation: "תוכן העניינים" 19 | 20 | - id: translations 21 | translation: "תרגומים" 22 | 23 | - id: home 24 | translation: "בית" 25 | 26 | - id: edit_post 27 | translation: "ערוך" 28 | 29 | - id: code_copy 30 | translation: "העתק" 31 | 32 | - id: code_copied 33 | translation: "!הועתק" 34 | -------------------------------------------------------------------------------- /i18n/zh-tw.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "上一頁" 3 | 4 | - id: next_page 5 | translation: "下一頁" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 分鐘" 10 | other: "{{ .Count }} 分鐘" 11 | 12 | - id: words 13 | translation: 14 | one: "字" 15 | other: "{{ .Count }} 字" 16 | 17 | - id: toc 18 | translation: "目錄" 19 | 20 | - id: translations 21 | translation: "語言" 22 | 23 | - id: home 24 | translation: "首頁" 25 | 26 | - id: edit_post 27 | translation: "編輯" 28 | 29 | - id: code_copy 30 | translation: "複製" 31 | 32 | - id: code_copied 33 | translation: "已複製!" 34 | -------------------------------------------------------------------------------- /i18n/th.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "ก่อนหน้า" 3 | 4 | - id: next_page 5 | translation: "ถัดไป" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 นาที" 10 | other: "{{ .Count }} นาที" 11 | 12 | - id: words 13 | translation: 14 | one : "คำ" 15 | other: "{{ .Count }} คำ" 16 | 17 | - id: toc 18 | translation: "สารบัญ" 19 | 20 | - id: translations 21 | translation: "การแปล" 22 | 23 | - id: home 24 | translation: "หน้าหลัก" 25 | 26 | - id: edit_post 27 | translation: "แก้ไข" 28 | 29 | - id: code_copy 30 | translation: "คัดลอก" 31 | 32 | - id: code_copied 33 | translation: "คัดลอกแล้ว!" 34 | -------------------------------------------------------------------------------- /i18n/cs.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Předchozí" 3 | 4 | - id: next_page 5 | translation: "Další" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one : "slovo" 15 | other: "{{ .Count }} slov" 16 | 17 | - id: toc 18 | translation: "Obsah" 19 | 20 | - id: translations 21 | translation: "Překlady" 22 | 23 | - id: home 24 | translation: "Domů" 25 | 26 | - id: edit_post 27 | translation: "Upravit" 28 | 29 | - id: code_copy 30 | translation: "kopírovat" 31 | 32 | - id: code_copied 33 | translation: "zkopírováno!" 34 | -------------------------------------------------------------------------------- /i18n/en.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Prev" 3 | 4 | - id: next_page 5 | translation: "Next" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one : "word" 15 | other: "{{ .Count }} words" 16 | 17 | - id: toc 18 | translation: "Table of Contents" 19 | 20 | - id: translations 21 | translation: "Translations" 22 | 23 | - id: home 24 | translation: "Home" 25 | 26 | - id: edit_post 27 | translation: "Edit" 28 | 29 | - id: code_copy 30 | translation: "copy" 31 | 32 | - id: code_copied 33 | translation: "copied!" 34 | -------------------------------------------------------------------------------- /layouts/partials/post_canonical.html: -------------------------------------------------------------------------------- 1 | {{ if and (.Params.canonicalURL) (.Params.ShowCanonicalLink ) -}} 2 | {{ $url := urls.Parse .Params.canonicalURL }} 3 | 4 | {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }} | {{- end -}} 5 | 6 | {{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}} 7 |  {{ $url.Host }} 8 | 9 | {{- end }} 10 | -------------------------------------------------------------------------------- /i18n/id.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Sebelumnya" 3 | 4 | - id: next_page 5 | translation: "Selanjutnya" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 menit" 10 | other: "{{ .Count }} menit" 11 | 12 | - id: words 13 | translation: 14 | one : "kata" 15 | other: "{{ .Count }} kata" 16 | 17 | - id: toc 18 | translation: "Daftar isi" 19 | 20 | - id: translations 21 | translation: "Terjemahan" 22 | 23 | - id: home 24 | translation: "Beranda" 25 | 26 | - id: edit_post 27 | translation: "Sunting" 28 | 29 | - id: code_copy 30 | translation: "salin" 31 | 32 | - id: code_copied 33 | translation: "disalin!" -------------------------------------------------------------------------------- /i18n/ro.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Înapoi" 3 | 4 | - id: next_page 5 | translation: "Înainte" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 minut" 10 | other: "{{ .Count }} minute" 11 | 12 | - id: words 13 | translation: 14 | one : "cuvânt" 15 | other: "{{ .Count }} cuvinte" 16 | 17 | - id: toc 18 | translation: "Sumar" 19 | 20 | - id: translations 21 | translation: "Traduceri" 22 | 23 | - id: home 24 | translation: "Acasă" 25 | 26 | - id: edit_post 27 | translation: "Editează" 28 | 29 | - id: code_copy 30 | translation: "copiază" 31 | 32 | - id: code_copied 33 | translation: "copiat!" 34 | -------------------------------------------------------------------------------- /i18n/tr.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Önceki" 3 | 4 | - id: next_page 5 | translation: "Sonraki" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 dk" 10 | other: "{{ .Count }} dk" 11 | 12 | - id: words 13 | translation: 14 | one : "kelime" 15 | other: "{{ .Count }} kelime" 16 | 17 | - id: toc 18 | translation: "İçindekiler" 19 | 20 | - id: translations 21 | translation: "Çeviriler" 22 | 23 | - id: home 24 | translation: "Anasayfa" 25 | 26 | - id: edit_post 27 | translation: "Düzenle" 28 | 29 | - id: code_copy 30 | translation: "Kopyala" 31 | 32 | - id: code_copied 33 | translation: "Kopyalandı!" 34 | -------------------------------------------------------------------------------- /i18n/fr.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Précédent" 3 | 4 | - id: next_page 5 | translation: "Suivant" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one : "mot" 15 | other: "{{ .Count }} mots" 16 | 17 | - id: toc 18 | translation: "Table des matières" 19 | 20 | - id: translations 21 | translation: "Traductions" 22 | 23 | - id: home 24 | translation: "Accueil" 25 | 26 | - id: edit_post 27 | translation: "Modifier" 28 | 29 | - id: code_copy 30 | translation: "Copier" 31 | 32 | - id: code_copied 33 | translation: "Copié !" 34 | -------------------------------------------------------------------------------- /i18n/no.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Forrige Side" 3 | 4 | - id: next_page 5 | translation: "Neste Side" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one: "ord" 15 | other: "{{ .Count }} ord" 16 | 17 | - id: toc 18 | translation: "Innholdsfortegnelse" 19 | 20 | - id: translations 21 | translation: "Oversettelser" 22 | 23 | - id: home 24 | translation: "Hjem" 25 | 26 | - id: edit_post 27 | translation: "Rediger" 28 | 29 | - id: code_copy 30 | translation: "Kopier" 31 | 32 | - id: code_copied 33 | translation: "Kopiert!" 34 | -------------------------------------------------------------------------------- /i18n/sw.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Uliopita" 3 | 4 | - id: next_page 5 | translation: "Ujao" 6 | 7 | - id: read_time 8 | translation: 9 | one : "dakika 1" 10 | other: "dakika {{ .Count }}" 11 | 12 | - id: words 13 | translation: 14 | one : "neno" 15 | other: "maneno {{ .Count }}" 16 | 17 | - id: toc 18 | translation: "Jedwali la Yaliyomo" 19 | 20 | - id: translations 21 | translation: "Tafsiri" 22 | 23 | - id: home 24 | translation: "Mwanzo" 25 | 26 | - id: edit_post 27 | translation: "Hariri" 28 | 29 | - id: code_copy 30 | translation: "nakili" 31 | 32 | - id: code_copied 33 | translation: "nakiliwa!" 34 | -------------------------------------------------------------------------------- /i18n/vi.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Trang trước" 3 | 4 | - id: next_page 5 | translation: "Trang tiếp theo" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 phút" 10 | other: "{{ .Count }} phút" 11 | 12 | - id: words 13 | translation: 14 | one: "từ" 15 | other: "{{ .Count }} từ" 16 | 17 | - id: toc 18 | translation: "Mục lục" 19 | 20 | - id: translations 21 | translation: "Bản dịch" 22 | 23 | - id: home 24 | translation: "Trang chủ" 25 | 26 | - id: edit_post 27 | translation: "Chỉnh sửa" 28 | 29 | - id: code_copy 30 | translation: "Sao chép" 31 | 32 | - id: code_copied 33 | translation: "Đã sao chép!" 34 | -------------------------------------------------------------------------------- /i18n/it.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Precedente" 3 | 4 | - id: next_page 5 | translation: "Successivo" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 minuto" 10 | other: "{{ .Count }} minuti" 11 | 12 | - id: words 13 | translation: 14 | one : "parola" 15 | other: "{{ .Count }} parole" 16 | 17 | - id: toc 18 | translation: "Indice contenuti" 19 | 20 | - id: translations 21 | translation: "Traduzioni" 22 | 23 | - id: home 24 | translation: "Home" 25 | 26 | - id: edit_post 27 | translation: "Modifica" 28 | 29 | - id: code_copy 30 | translation: "copia" 31 | 32 | - id: code_copied 33 | translation: "copiato!" 34 | -------------------------------------------------------------------------------- /i18n/nl.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Vorige" 3 | 4 | - id: next_page 5 | translation: "Volgende" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one : "woord" 15 | other: "{{ .Count }} woorden" 16 | 17 | - id: toc 18 | translation: "Inhoudsopgave" 19 | 20 | - id: translations 21 | translation: "Vertalingen" 22 | 23 | - id: home 24 | translation: "Startpagina" 25 | 26 | - id: edit_post 27 | translation: "Bewerk" 28 | 29 | - id: code_copy 30 | translation: "kopieer" 31 | 32 | - id: code_copied 33 | translation: "gekopieerd!" 34 | -------------------------------------------------------------------------------- /i18n/pl.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Poprzednia" 3 | 4 | - id: next_page 5 | translation: "Następna" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one : "słowo" 15 | other: "{{ .Count }} słów" 16 | 17 | - id: toc 18 | translation: "Spis treści" 19 | 20 | - id: translations 21 | translation: "Tłumaczenia" 22 | 23 | - id: home 24 | translation: "Strona Główna" 25 | 26 | - id: edit_post 27 | translation: "Edytuj" 28 | 29 | - id: code_copy 30 | translation: "Kopiuj" 31 | 32 | - id: code_copied 33 | translation: "Skopiowano!" 34 | -------------------------------------------------------------------------------- /i18n/bn.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "পূর্ববর্তী" 3 | 4 | - id: next_page 5 | translation: "পরবর্তী" 6 | 7 | - id: read_time 8 | translation: 9 | one : "১ মিনিট" 10 | other: "{{ .Count }} মিনিট" 11 | 12 | - id: words 13 | translation: 14 | one : "১ টি শব্দ" 15 | other: "{{ .Count }} টি শব্দ" 16 | 17 | - id: toc 18 | translation: "সূচিপত্র" 19 | 20 | - id: translations 21 | translation: "অনুবাদসমূহ" 22 | 23 | - id: home 24 | translation: "হোম" 25 | 26 | - id: edit_post 27 | translation: "সম্পাদনা করুন" 28 | 29 | - id: code_copy 30 | translation: "কপি করুন" 31 | 32 | - id: code_copied 33 | translation: "কপি হয়েছে!" 34 | -------------------------------------------------------------------------------- /i18n/de.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Vorherige" 3 | 4 | - id: next_page 5 | translation: "Nächste" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 Minute" 10 | other: "{{ .Count }} Minuten" 11 | 12 | - id: words 13 | translation: 14 | one : "Wort" 15 | other: "{{ .Count }} Wörter" 16 | 17 | - id: toc 18 | translation: "Inhaltsverzeichnis" 19 | 20 | - id: translations 21 | translation: "Übersetzungen" 22 | 23 | - id: home 24 | translation: "Home" 25 | 26 | - id: edit_post 27 | translation: "Bearbeiten" 28 | 29 | - id: code_copy 30 | translation: "Kopieren" 31 | 32 | - id: code_copied 33 | translation: "Kopiert!" 34 | -------------------------------------------------------------------------------- /i18n/el.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Προηγούμενο" 3 | 4 | - id: next_page 5 | translation: "Επόμενο" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 λεπτό" 10 | other: "{{ .Count }} λεπτά" 11 | 12 | - id: words 13 | translation: 14 | one: "λέξη" 15 | other: "{{ .Count }} λέξεις" 16 | 17 | - id: toc 18 | translation: "Πίνακας Περιεχομένων" 19 | 20 | - id: translations 21 | translation: "Μεταφράσεις" 22 | 23 | - id: home 24 | translation: "Αρχική" 25 | 26 | - id: edit_post 27 | translation: "Επεξεργασία" 28 | 29 | - id: code_copy 30 | translation: "αντιγραφή" 31 | 32 | - id: code_copied 33 | translation: "αντιγράφηκε!" -------------------------------------------------------------------------------- /i18n/es.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Anterior" 3 | 4 | - id: next_page 5 | translation: "Siguiente" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 min" 10 | other: "{{ .Count }} min" 11 | 12 | - id: words 13 | translation: 14 | one : "palabra" 15 | other: "{{ .Count }} palabras" 16 | 17 | - id: toc 18 | translation: "Tabla de Contenidos" 19 | 20 | - id: translations 21 | translation: "Traducciones" 22 | 23 | - id: home 24 | translation: "Inicio" 25 | 26 | - id: edit_post 27 | translation: "Editar" 28 | 29 | - id: code_copy 30 | translation: "copiar" 31 | 32 | - id: code_copied 33 | translation: "¡copiado!" 34 | -------------------------------------------------------------------------------- /i18n/pt.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Página Anterior" 3 | 4 | - id: next_page 5 | translation: "Próxima Página" 6 | 7 | - id: read_time 8 | translation: 9 | one: "1 minuto" 10 | other: "{{ .Count }} minutos" 11 | 12 | - id: words 13 | translation: 14 | one : "palavra" 15 | other: "{{ .Count }} palavras" 16 | 17 | - id: toc 18 | translation: "Conteúdo" 19 | 20 | - id: translations 21 | translation: "Traduções" 22 | 23 | - id: home 24 | translation: "Início" 25 | 26 | - id: edit_post 27 | translation: "Editar" 28 | 29 | - id: code_copy 30 | translation: "copiar" 31 | 32 | - id: code_copied 33 | translation: "copiado!" 34 | -------------------------------------------------------------------------------- /layouts/partials/edit_post.html: -------------------------------------------------------------------------------- 1 | {{- if and (or .Params.editPost.URL site.Params.editPost.URL) (not (.Param "editPost.disabled")) -}} 2 | {{- $fileUrlPath := path.Join .File.Path }} 3 | 4 | {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}} 5 | 6 | {{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} 7 | 8 | {{- end }} 9 | -------------------------------------------------------------------------------- /i18n/hr.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Prethodna stranica" 3 | 4 | - id: next_page 5 | translation: "Sljedeća stranica" 6 | 7 | - id: read_time 8 | translation: 9 | one : "1 minuta" 10 | other: "{{ .Count }} minute" 11 | 12 | - id: words 13 | translation: 14 | one : "riječ" 15 | other: "{{ .Count }} riječi" 16 | 17 | - id: toc 18 | translation: "Tablica Sadržaja" 19 | 20 | - id: translations 21 | translation: "Prijevodi" 22 | 23 | - id: home 24 | translation: "Početna stranica" 25 | 26 | - id: edit_post 27 | translation: "Promjeni" 28 | 29 | - id: code_copy 30 | translation: "kopiraj" 31 | 32 | - id: code_copied 33 | translation: "kopirano!" 34 | -------------------------------------------------------------------------------- /layouts/partials/translation_list.html: -------------------------------------------------------------------------------- 1 | {{- if .IsTranslated -}} 2 | {{- if (ne .Layout "search") }} 3 | {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}} 4 | {{- end }} 5 | {{- i18n "translations" | default "Translations" }}: 6 | 19 | {{- end -}} 20 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 7 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 3 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - keep 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /layouts/_default/terms.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 | {{- if .Title }} 4 | 12 | {{- end }} 13 | 14 | 26 | 27 | {{- end }}{{/* end main */ -}} 28 | -------------------------------------------------------------------------------- /layouts/partials/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {{- if (.Param "ShowBreadCrumbs") -}} 2 | 19 | {{- end -}} 20 | -------------------------------------------------------------------------------- /i18n/ru.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Предыдущая" 3 | 4 | - id: next_page 5 | translation: "Следующая" 6 | 7 | - id: read_time 8 | translation: 9 | zero: "0 минут" 10 | one: "1 минута" 11 | few: "{{ .Count }} минуты" 12 | many: "{{ .Count }} минут" 13 | other: "{{ .Count }} минута" 14 | 15 | - id: words 16 | translation: 17 | zero: "0 слов" 18 | one: "1 слово" 19 | few: "{{ .Count }} слова" 20 | many: "{{ .Count }} слов" 21 | other: "{{ .Count }} слово" 22 | 23 | - id: toc 24 | translation: "Оглавление" 25 | 26 | - id: translations 27 | translation: "Переводы" 28 | 29 | - id: home 30 | translation: "Главная" 31 | 32 | - id: edit_post 33 | translation: "Редактировать" 34 | 35 | - id: code_copy 36 | translation: "копировать" 37 | 38 | - id: code_copied 39 | translation: "скопировано!" -------------------------------------------------------------------------------- /i18n/be.yaml: -------------------------------------------------------------------------------- 1 | - id: prev_page 2 | translation: "Папярэдняя" 3 | 4 | - id: next_page 5 | translation: "Наступная" 6 | 7 | - id: read_time 8 | translation: 9 | zero: "0 хвілін" 10 | one: "1 хвіліна" 11 | few: "{{ .Count }} хвіліны" 12 | many: "{{ .Count }} хвілін" 13 | other: "{{ .Count }} хвілін" 14 | 15 | - id: words 16 | translation: 17 | zero: "няма слоў" 18 | one: "1 слова" 19 | few: "{{ .Count }} слова" 20 | many: "{{ .Count }} слоў" 21 | other: "{{ .Count }} слова" 22 | 23 | - id: toc 24 | translation: "Змест" 25 | 26 | - id: translations 27 | translation: "Пераклады" 28 | 29 | - id: home 30 | translation: "Галоўная" 31 | 32 | - id: edit_post 33 | translation: "Рэдагаваць" 34 | 35 | - id: code_copy 36 | translation: "капіяваць" 37 | 38 | - id: code_copied 39 | translation: "скапіявана!" 40 | -------------------------------------------------------------------------------- /assets/css/common/archive.css: -------------------------------------------------------------------------------- 1 | .archive-posts { 2 | width: 100%; 3 | font-size: 16px; 4 | } 5 | 6 | .archive-year { 7 | margin-top: 40px; 8 | } 9 | 10 | .archive-year:not(:last-of-type) { 11 | border-bottom: 2px solid var(--border); 12 | } 13 | 14 | .archive-month { 15 | display: flex; 16 | align-items: flex-start; 17 | padding: 10px 0; 18 | } 19 | 20 | .archive-month-header { 21 | margin: 25px 0; 22 | width: 200px; 23 | } 24 | 25 | .archive-month:not(:last-of-type) { 26 | border-bottom: 1px solid var(--border); 27 | } 28 | 29 | .archive-entry { 30 | position: relative; 31 | padding: 5px; 32 | margin: 10px 0; 33 | } 34 | 35 | .archive-entry-title { 36 | margin: 5px 0; 37 | font-weight: 400; 38 | } 39 | 40 | .archive-count, 41 | .archive-meta { 42 | color: var(--secondary); 43 | font-size: 14px; 44 | } 45 | -------------------------------------------------------------------------------- /layouts/partials/post_meta.html: -------------------------------------------------------------------------------- 1 | {{- $scratch := newScratch }} 2 | 3 | {{- if not .Date.IsZero -}} 4 | {{- $scratch.Add "meta" (slice (printf "%s" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} 5 | {{- end }} 6 | 7 | {{- if (.Param "ShowReadingTime") -}} 8 | {{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} 9 | {{- end }} 10 | 11 | {{- if (.Param "ShowWordCount") -}} 12 | {{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} 13 | {{- end }} 14 | 15 | {{- if not (.Param "hideAuthor") -}} 16 | {{- with (partial "author.html" .) }} 17 | {{- $scratch.Add "meta" (slice .) }} 18 | {{- end }} 19 | {{- end }} 20 | 21 | {{- with ($scratch.Get "meta") }} 22 | {{- delimit . " · " | safeHTML -}} 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | {{- if lt hugo.Version "0.112.4" }} 2 | {{- errorf "=> hugo v0.112.4 or greater is required for hugo-PaperMod to build " }} 3 | {{- end -}} 4 | 5 | 6 | 7 | 8 | 9 | {{- partial "head.html" . }} 10 | 11 | 12 | 20 | {{- partialCached "header.html" . .Page -}} 21 |
22 | {{- block "main" . }}{{ end }} 23 |
24 | {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /assets/css/common/profile-mode.css: -------------------------------------------------------------------------------- 1 | .buttons, 2 | .main .profile { 3 | display: flex; 4 | justify-content: center; 5 | } 6 | 7 | .main .profile { 8 | align-items: center; 9 | min-height: calc(100vh - var(--header-height) - var(--footer-height) - (var(--gap) * 2)); 10 | text-align: center; 11 | } 12 | 13 | .profile .profile_inner { 14 | display: flex; 15 | flex-direction: column; 16 | align-items: center; 17 | gap: 10px; 18 | } 19 | 20 | .profile img { 21 | border-radius: 50%; 22 | } 23 | 24 | .buttons { 25 | flex-wrap: wrap; 26 | max-width: 400px; 27 | } 28 | 29 | .button { 30 | background: var(--tertiary); 31 | border-radius: var(--radius); 32 | margin: 8px; 33 | padding: 6px; 34 | transition: transform 0.1s; 35 | } 36 | 37 | .button-inner { 38 | padding: 0 8px; 39 | } 40 | 41 | .button:active { 42 | transform: scale(0.96); 43 | } 44 | -------------------------------------------------------------------------------- /assets/css/core/theme-vars.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --gap: 24px; 3 | --content-gap: 20px; 4 | --nav-width: 1024px; 5 | --main-width: 720px; 6 | --header-height: 60px; 7 | --footer-height: 60px; 8 | --radius: 8px; 9 | --theme: #e2e4f2; 10 | --entry: #efefff; 11 | --primary: rgb(30, 30, 30); 12 | --secondary: rgb(108, 108, 108); 13 | --tertiary: #c3c5d0; 14 | --content: rgb(31, 31, 31); 15 | --code-bg: #e2e4f2; 16 | --border: rgb(238, 238, 238); 17 | } 18 | 19 | .dark { 20 | --theme: #1f2125; 21 | --entry: #26282e; 22 | --primary: rgb(218, 218, 219); 23 | --secondary: rgb(155, 156, 157); 24 | --tertiary: #3a3c42; 25 | --content: rgb(196, 196, 197); 26 | --code-bg: rgb(55, 56, 62); 27 | --border: none; 28 | } 29 | 30 | .list { 31 | background: var(--code-bg); 32 | } 33 | 34 | .dark.list { 35 | background: var(--theme); 36 | } 37 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | {{- if not (.Param "hideFooter") }} 2 | 14 | {{- end }} 15 | 16 | {{- if (not site.Params.disableScrollToTop) }} 17 | 18 | 19 | 20 | 21 | 22 | {{- end }} 23 | 24 | {{- partial "extend_footer.html" . }} 25 | 26 | {{- partial "script.html" . }} 27 | -------------------------------------------------------------------------------- /assets/css/common/search.css: -------------------------------------------------------------------------------- 1 | #searchbox input { 2 | padding: 4px 10px; 3 | width: 100%; 4 | color: var(--primary); 5 | font-weight: bold; 6 | border: 2px solid var(--tertiary); 7 | border-radius: var(--radius); 8 | } 9 | 10 | #searchbox input:focus { 11 | border-color: var(--secondary); 12 | } 13 | 14 | #searchResults li { 15 | list-style: none; 16 | border-radius: var(--radius); 17 | padding: 10px; 18 | margin: 10px 0; 19 | position: relative; 20 | font-weight: 500; 21 | } 22 | 23 | #searchResults { 24 | margin: 10px 0; 25 | width: 100%; 26 | } 27 | 28 | #searchResults li:active { 29 | transition: transform 0.1s; 30 | transform: scale(0.98); 31 | } 32 | 33 | #searchResults a { 34 | position: absolute; 35 | width: 100%; 36 | height: 100%; 37 | top: 0px; 38 | left: 0px; 39 | outline: none; 40 | } 41 | 42 | #searchResults .focus { 43 | transform: scale(0.98); 44 | border: 2px solid var(--tertiary); 45 | } 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 nanxiaobei and adityatelange 4 | Copyright (c) 2021-2023 adityatelange 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /layouts/_default/search.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 | 22 | 23 | 31 | 32 | {{- end }}{{/* end main */}} 33 | -------------------------------------------------------------------------------- /assets/css/core/zmedia.css: -------------------------------------------------------------------------------- 1 | @media screen and (max-width: 768px) { 2 | /* theme-vars */ 3 | :root { 4 | --gap: 14px; 5 | } 6 | 7 | /* profile-mode */ 8 | .profile img { 9 | transform: scale(0.85); 10 | } 11 | 12 | /* post-entry */ 13 | .first-entry { 14 | min-height: 260px; 15 | } 16 | 17 | /* archive */ 18 | .archive-month { 19 | flex-direction: column; 20 | } 21 | 22 | .archive-year { 23 | margin-top: 20px; 24 | } 25 | 26 | /* footer */ 27 | .footer { 28 | padding: calc((var(--footer-height) - var(--gap) - 10px) / 2) var(--gap); 29 | } 30 | } 31 | 32 | /* footer */ 33 | @media screen and (max-width: 900px) { 34 | .list .top-link { 35 | transform: translateY(-5rem); 36 | } 37 | } 38 | 39 | @media screen and (max-width: 340px) { 40 | .share-buttons { 41 | justify-content: unset; 42 | } 43 | } 44 | 45 | @media (prefers-reduced-motion) { 46 | /* terms; profile-mode; post-single; post-entry; post-entry; search; search */ 47 | .terms-tags a:active, 48 | .button:active, 49 | .post-entry:active, 50 | .top-link, 51 | #searchResults .focus, 52 | #searchResults li:active { 53 | transform: none; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/gohugoio/hugoThemes#themetoml for an example 3 | 4 | name = "WonderMod" 5 | license = "MIT" 6 | licenselink = "https://github.com/Wonderfall/hugo-WonderMod/blob/master/LICENSE" 7 | description = "A fast, clean, responsive Hugo theme" 8 | homepage = "https://github.com/Wonderfall/hugo-WonderMod" 9 | tags = [ 10 | "responsive", 11 | "simple", 12 | "clean", 13 | "light", 14 | "dark", 15 | "blog", 16 | "minimalist", 17 | "highlight.js", 18 | "search" 19 | ] 20 | features = [ 21 | "responsive", 22 | "single-column", 23 | "blog", 24 | "cover-image", 25 | "table-of-contents", 26 | "opengraph", 27 | "highlight.js", 28 | "favicon", 29 | "archive", 30 | "share-icons", 31 | "cover", 32 | "multilingual", 33 | "social-icons", 34 | "minified-assets", 35 | "theme-toggle", 36 | "menu-location-indicator", 37 | "scroll-to-top", 38 | "search" 39 | ] 40 | min_version = "0.112.4" 41 | 42 | [author] 43 | name = "Wonderfall" 44 | homepage = "https://github.com/Wonderfall" 45 | 46 | # If porting an existing theme 47 | [original] 48 | name = "PaperMod" 49 | author = "Aditya Telange" 50 | homepage = "https://github.com/adityatelange" 51 | repo = "https://github.com/adityatelange/hugo-PaperMod" 52 | -------------------------------------------------------------------------------- /assets/css/common/footer.css: -------------------------------------------------------------------------------- 1 | .footer, 2 | .top-link { 3 | font-size: 12px; 4 | color: var(--secondary); 5 | } 6 | 7 | .footer { 8 | max-width: calc(var(--main-width) + var(--gap) * 2); 9 | margin: auto; 10 | padding: calc((var(--footer-height) - var(--gap)) / 2) var(--gap); 11 | text-align: center; 12 | line-height: 24px; 13 | } 14 | 15 | .footer span { 16 | margin-inline-start: 1px; 17 | margin-inline-end: 1px; 18 | } 19 | 20 | .footer span:last-child { 21 | white-space: nowrap; 22 | } 23 | 24 | .footer a { 25 | color: inherit; 26 | border-bottom: 1px solid var(--secondary); 27 | } 28 | 29 | .footer a:hover { 30 | border-bottom: 1px solid var(--primary); 31 | } 32 | 33 | .top-link { 34 | visibility: hidden; 35 | position: fixed; 36 | bottom: 60px; 37 | right: 30px; 38 | z-index: 99; 39 | background: var(--tertiary); 40 | width: 42px; 41 | height: 42px; 42 | padding: 12px; 43 | border-radius: 64px; 44 | transition: visibility 0.5s, opacity 0.8s linear; 45 | } 46 | 47 | .top-link, 48 | .top-link svg { 49 | filter: drop-shadow(0px 0px 0px var(--theme)); 50 | } 51 | 52 | .footer a:hover, 53 | .top-link:hover { 54 | color: var(--primary); 55 | } 56 | 57 | .top-link:focus, 58 | #theme-toggle:focus { 59 | outline: 0; 60 | } 61 | -------------------------------------------------------------------------------- /assets/css/common/main.css: -------------------------------------------------------------------------------- 1 | .main { 2 | position: relative; 3 | min-height: calc(100vh - var(--header-height) - var(--footer-height)); 4 | max-width: calc(var(--main-width) + var(--gap) * 2); 5 | margin: auto; 6 | padding: var(--gap); 7 | } 8 | 9 | .page-header h1 { 10 | font-size: 40px; 11 | } 12 | 13 | .pagination { 14 | display: flex; 15 | } 16 | 17 | .pagination a { 18 | color: var(--theme); 19 | font-size: 13px; 20 | line-height: 36px; 21 | background: var(--primary); 22 | border-radius: calc(36px / 2); 23 | padding: 0 16px; 24 | } 25 | 26 | .pagination .next { 27 | margin-inline-start: auto; 28 | } 29 | 30 | 31 | .social-icons a { 32 | display: inline-flex; 33 | padding: 10px; 34 | } 35 | 36 | .social-icons a svg { 37 | height: 26px; 38 | width: 26px; 39 | } 40 | 41 | code { 42 | direction: ltr; 43 | } 44 | 45 | div.highlight, 46 | pre { 47 | position: relative; 48 | } 49 | 50 | .copy-code { 51 | display: none; 52 | position: absolute; 53 | top: 4px; 54 | right: 4px; 55 | color: rgba(255, 255, 255, 0.8); 56 | background: rgba(78, 78, 78, 0.8); 57 | border-radius: var(--radius); 58 | padding: 0 5px; 59 | font-size: 14px; 60 | user-select: none; 61 | } 62 | 63 | div.highlight:hover .copy-code, 64 | pre:hover .copy-code { 65 | display: block; 66 | } 67 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 22 | 23 | **Describe the bug** 24 | 25 | 26 | - Device/Os: [e.g. Android 10] 27 | - Type: [e.g. Desktop/Mobile] 28 | - Browser and version [e.g. Chrome 86.0]: 29 | - Hugo Version [ >=0.112.4 expected]: 30 | - Theme Version [e.g. v4.0, master, or commit-id ]: 31 | 32 | **Steps to reproduce the behavior:** 33 | 39 | 40 | **Expected behavior**: 41 | 42 | 43 | **Repo/Source where this issue can be reproduced**: 44 | 45 | 46 | **Screenshots** 47 | 48 | 49 | **Additional context** 50 | 51 | -------------------------------------------------------------------------------- /layouts/shortcodes/figure.html: -------------------------------------------------------------------------------- 1 | 5 | {{- if .Get "link" -}} 6 | 7 | {{- end }} 8 | {{ with .Get 15 | {{- if .Get "link" }}{{ end -}} 16 | {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} 17 |
18 | {{ with (.Get "title") -}} 19 | {{ . }} 20 | {{- end -}} 21 | {{- if or (.Get "caption") (.Get "attr") -}}

22 | {{- .Get "caption" | markdownify -}} 23 | {{- with .Get "attrlink" }} 24 | 25 | {{- end -}} 26 | {{- .Get "attr" | markdownify -}} 27 | {{- if .Get "attrlink" }}{{ end }}

28 | {{- end }} 29 |
30 | {{- end }} 31 | 32 | -------------------------------------------------------------------------------- /assets/css/includes/scroll-bar.css: -------------------------------------------------------------------------------- 1 | /* from reset */ 2 | ::-webkit-scrollbar-track { 3 | background: 0 0; 4 | } 5 | 6 | .list:not(.dark)::-webkit-scrollbar-track { 7 | background: var(--code-bg); 8 | } 9 | 10 | ::-webkit-scrollbar-thumb { 11 | background: var(--tertiary); 12 | border: 5px solid var(--theme); 13 | border-radius: var(--radius); 14 | } 15 | 16 | .list:not(.dark)::-webkit-scrollbar-thumb { 17 | border: 5px solid var(--code-bg); 18 | } 19 | 20 | ::-webkit-scrollbar-thumb:hover { 21 | background: var(--secondary); 22 | } 23 | 24 | ::-webkit-scrollbar:not(.highlighttable, .highlight table, .gist .highlight) { 25 | background: var(--theme); 26 | } 27 | 28 | /* from post-single */ 29 | .post-content .highlighttable td .highlight pre code::-webkit-scrollbar { 30 | display: none; 31 | } 32 | 33 | .post-content :not(table) ::-webkit-scrollbar-thumb { 34 | border: 2px solid var(--hljs-bg); 35 | background: rgb(113, 113, 117); 36 | } 37 | 38 | .post-content :not(table) ::-webkit-scrollbar-thumb:hover { 39 | background: rgb(163, 163, 165); 40 | } 41 | 42 | .gist table::-webkit-scrollbar-thumb { 43 | border: 2px solid rgb(255, 255, 255); 44 | background: rgb(173, 173, 173); 45 | } 46 | 47 | .gist table::-webkit-scrollbar-thumb:hover { 48 | background: rgb(112, 112, 112); 49 | } 50 | 51 | .post-content table::-webkit-scrollbar-thumb { 52 | border-width: 2px; 53 | } 54 | 55 | /* from zmedia */ 56 | @media screen and (min-width: 768px) { 57 | 58 | /* reset */ 59 | ::-webkit-scrollbar { 60 | width: 19px; 61 | height: 11px; 62 | } 63 | } 64 | 65 | /* side ToC */ 66 | 67 | .toc.side::-webkit-scrollbar-thumb { 68 | border: none; 69 | background: var(--secondary); 70 | } 71 | 72 | .toc.side::-webkit-scrollbar { 73 | width: 8px; 74 | } 75 | 76 | /* code */ 77 | 78 | .highlight pre code::-webkit-scrollbar { 79 | height: 6px; 80 | } -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | **What does this PR change? What problem does it solve?** 18 | 19 | 24 | 25 | 26 | **Was the change discussed in an issue or in the Discussions before?** 27 | 28 | 34 | 35 | 36 | ## PR Checklist 37 | 38 | - [ ] This change adds/updates translations and I have used the [template present here](https://github.com/adityatelange/hugo-PaperMod/wiki/Translations#want-to-add-your-language-). 39 | - [ ] I have enabled [maintainer edits for this PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork). 40 | - [ ] I have verified that the code works as described/as intended. 41 | - [ ] This change adds a Social Icon which has a permissive license to use it. 42 | - [ ] This change **does not** include any CDN resources/links. 43 | - [ ] This change **does not** include any unrelated scripts such as bash and python scripts. 44 | - [ ] This change updates the overridden internal templates from HUGO's repository. 45 | -------------------------------------------------------------------------------- /layouts/partials/script.html: -------------------------------------------------------------------------------- 1 | {{- /* Search */}} 2 | {{- if (eq .Layout `search`) -}} 3 | 4 | {{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }} 5 | {{- $fusejs := resources.Get "js/fuse.basic.min.js" }} 6 | {{- $license_js := resources.Get "js/license.js" }} 7 | {{- if not site.Params.assets.disableFingerprinting }} 8 | {{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }} 9 | 10 | {{- else }} 11 | {{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }} 12 | 13 | {{- end }} 14 | {{- end -}} 15 | 16 | {{- /* PaperMod.js */}} 17 | {{- $scrollToTop := (not site.Params.disableScrollToTop | default .Params.disableScrollToTop ) }} 18 | {{- $themeToggle := (not site.Params.disableThemeToggle | default .Params.disableThemeToggle ) }} 19 | {{- $showCodeCopyButtons := (site.Params.ShowCodeCopyButtons | default .Params.ShowCodeCopyButtons ) }} 20 | {{- $papermod := resources.Get "js/papermod.js" | js.Build (dict "params" (dict "scrollToTop" $scrollToTop "themeToggle" $themeToggle "showCodeCopyButtons" $showCodeCopyButtons)) | resources.Minify }} 21 | {{- if not site.Params.assets.disableFingerprinting }} 22 | {{- $papermod_js := (slice $papermod) | resources.Concat "assets/js/papermod.js" | fingerprint }} 23 | 24 | {{- else }} 25 | {{- $papermod_js := (slice $papermod) | resources.Concat "assets/js/papermod.js" }} 26 | 27 | {{- end }} -------------------------------------------------------------------------------- /assets/css/core/reset.css: -------------------------------------------------------------------------------- 1 | *, 2 | ::after, 3 | ::before { 4 | box-sizing: border-box; 5 | } 6 | 7 | html { 8 | -webkit-tap-highlight-color: transparent; 9 | overflow-y: scroll; 10 | scroll-behavior: smooth; 11 | -webkit-text-size-adjust: 100%; 12 | text-size-adjust: 100%; 13 | } 14 | 15 | a, 16 | button, 17 | body, 18 | h1, 19 | h2, 20 | h3, 21 | h4, 22 | h5, 23 | h6 { 24 | color: var(--primary); 25 | } 26 | 27 | body { 28 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; 29 | font-size: 18px; 30 | line-height: 1.6; 31 | word-break: break-word; 32 | background: var(--theme); 33 | } 34 | 35 | article, 36 | aside, 37 | figcaption, 38 | figure, 39 | footer, 40 | header, 41 | hgroup, 42 | main, 43 | nav, 44 | section, 45 | table { 46 | display: block; 47 | } 48 | 49 | h1, 50 | h2, 51 | h3, 52 | h4, 53 | h5, 54 | h6 { 55 | line-height: 1.2; 56 | } 57 | 58 | h1, 59 | h2, 60 | h3, 61 | h4, 62 | h5, 63 | h6, 64 | p { 65 | margin-top: 0; 66 | margin-bottom: 0; 67 | } 68 | 69 | ul { 70 | padding: 0; 71 | } 72 | 73 | a { 74 | text-decoration: none; 75 | } 76 | 77 | body, 78 | figure, 79 | ul { 80 | margin: 0; 81 | } 82 | 83 | table { 84 | width: 100%; 85 | border-collapse: collapse; 86 | border-spacing: 0; 87 | overflow-x: auto; 88 | word-break: keep-all; 89 | } 90 | 91 | button, 92 | input, 93 | textarea { 94 | padding: 0; 95 | font: inherit; 96 | background: 0 0; 97 | border: 0; 98 | } 99 | 100 | input, 101 | textarea { 102 | outline: 0; 103 | } 104 | 105 | button, 106 | input[type=button], 107 | input[type=submit] { 108 | cursor: pointer; 109 | } 110 | 111 | input:-webkit-autofill, 112 | textarea:-webkit-autofill { 113 | box-shadow: 0 0 0 50px var(--theme) inset; 114 | } 115 | 116 | img { 117 | display: block; 118 | max-width: 100%; 119 | } 120 | -------------------------------------------------------------------------------- /layouts/partials/templates/twitter_cards.html: -------------------------------------------------------------------------------- 1 | {{- if .Params.cover.image -}} 2 | 3 | {{- if (ne $.Params.cover.relative true) }} 4 | 5 | {{- else }} 6 | 7 | {{- end}} 8 | {{- else }} 9 | {{- with $.Params.images -}} 10 | 11 | 12 | {{ else -}} 13 | {{- $images := $.Resources.ByType "image" -}} 14 | {{- $featured := $images.GetMatch "*feature*" -}} 15 | {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} 16 | {{- with $featured -}} 17 | 18 | 19 | {{- else -}} 20 | {{- with site.Params.images -}} 21 | 22 | 23 | {{ else -}} 24 | 25 | {{- end -}} 26 | {{- end -}} 27 | {{- end }} 28 | {{- end }} 29 | 30 | 31 | {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} 32 | {{- $twitterSite := "" }} 33 | {{- with site.Params.social }} 34 | {{- if reflect.IsMap . }} 35 | {{- $twitterSite = .twitter }} 36 | {{- end }} 37 | {{- else }} 38 | {{- with site.Social.twitter }} 39 | {{- $twitterSite = . }} 40 | {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} 41 | {{- end }} 42 | {{- end }} 43 | 44 | {{- with $twitterSite }} 45 | {{- $content := . }} 46 | {{- if not (strings.HasPrefix . "@") }} 47 | {{- $content = printf "@%v" $twitterSite }} 48 | {{- end }} 49 | 50 | {{- end }} 51 | -------------------------------------------------------------------------------- /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Hugo PaperMod Demo to Pages 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - "images/**" 7 | - "LICENSE" 8 | - "README.md" 9 | branches: 10 | - master 11 | - exampleSite 12 | workflow_dispatch: 13 | # manual run 14 | inputs: 15 | hugoVersion: 16 | description: "Hugo Version" 17 | required: false 18 | default: "0.112.4" 19 | 20 | # Allow one concurrent deployment 21 | concurrency: 22 | group: "pages" 23 | cancel-in-progress: true 24 | 25 | # Default to bash 26 | defaults: 27 | run: 28 | shell: bash 29 | 30 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 31 | permissions: 32 | contents: read 33 | pages: write 34 | id-token: write 35 | 36 | jobs: 37 | # Build job 38 | build: 39 | runs-on: ubuntu-latest 40 | env: 41 | HUGO_VERSION: "0.112.4" 42 | steps: 43 | - name: Check version 44 | if: ${{ github.event.inputs.hugoVersion }} 45 | run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}" 46 | - name: Install Hugo CLI 47 | run: | 48 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \ 49 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 50 | - name: Checkout 51 | uses: actions/checkout@v3 52 | with: 53 | ref: exampleSite 54 | - name: Setup Pages 55 | id: pages 56 | uses: actions/configure-pages@v3 57 | - name: Get Theme 58 | run: git submodule update --init --recursive 59 | - name: Update theme to Latest commit 60 | run: git submodule update --remote --merge 61 | - name: Build with Hugo 62 | run: | 63 | hugo \ 64 | --buildDrafts --gc --verbose \ 65 | --baseURL ${{ steps.pages.outputs.base_url }} 66 | - name: Upload artifact 67 | uses: actions/upload-pages-artifact@v2 68 | with: 69 | path: ./public 70 | # Deployment job 71 | deploy: 72 | environment: 73 | name: github-pages 74 | url: ${{ steps.deployment.outputs.page_url }} 75 | runs-on: ubuntu-latest 76 | needs: build 77 | steps: 78 | - name: Deploy to GitHub Pages 79 | id: deployment 80 | uses: actions/deploy-pages@v2 81 | -------------------------------------------------------------------------------- /assets/css/common/post-entry.css: -------------------------------------------------------------------------------- 1 | .first-entry { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | justify-content: center; 6 | min-height: 220px; 7 | margin: var(--gap) 0 calc(var(--gap) * 2) 0; 8 | } 9 | 10 | .first-entry .entry-header { 11 | overflow: hidden; 12 | display: -webkit-box; 13 | -webkit-box-orient: vertical; 14 | -webkit-line-clamp: 3; 15 | } 16 | 17 | .first-entry .entry-header h1 { 18 | font-size: 34px; 19 | line-height: 1.4; 20 | } 21 | 22 | .first-entry .entry-content { 23 | margin: 14px 0; 24 | font-size: 16px; 25 | -webkit-line-clamp: 3; 26 | } 27 | 28 | .first-entry .entry-footer { 29 | font-size: 14px; 30 | } 31 | 32 | .home-info .entry-content { 33 | -webkit-line-clamp: unset; 34 | } 35 | 36 | .post-entry { 37 | position: relative; 38 | margin-bottom: var(--gap); 39 | padding: var(--gap); 40 | background: var(--entry); 41 | border-radius: var(--radius); 42 | transition: transform 0.1s; 43 | border: 1px solid var(--border); 44 | } 45 | 46 | .post-entry:active { 47 | transform: scale(0.96); 48 | } 49 | 50 | .tag-entry .entry-cover { 51 | display: none; 52 | } 53 | 54 | .entry-header h2 { 55 | font-size: 24px; 56 | line-height: 1.3; 57 | } 58 | 59 | .entry-content { 60 | margin: 8px 0; 61 | color: var(--secondary); 62 | font-size: 14px; 63 | line-height: 1.6; 64 | overflow: hidden; 65 | display: -webkit-box; 66 | -webkit-box-orient: vertical; 67 | -webkit-line-clamp: 2; 68 | } 69 | 70 | .entry-footer { 71 | color: var(--secondary); 72 | font-size: 13px; 73 | } 74 | 75 | .entry-link { 76 | position: absolute; 77 | left: 0; 78 | right: 0; 79 | top: 0; 80 | bottom: 0; 81 | } 82 | 83 | .entry-hint { 84 | color: var(--secondary); 85 | } 86 | 87 | .entry-hint-parent { 88 | display: flex; 89 | justify-content: space-between; 90 | } 91 | 92 | .entry-cover { 93 | font-size: 14px; 94 | margin-bottom: var(--gap); 95 | text-align: center; 96 | } 97 | 98 | .entry-cover img { 99 | border-radius: var(--radius); 100 | pointer-events: none; 101 | width: 100%; 102 | height: auto; 103 | } 104 | 105 | .entry-cover a { 106 | color: var(--secondary); 107 | box-shadow: 0 1px 0 var(--primary); 108 | } 109 | -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 |
4 |
5 | {{ partial "breadcrumbs.html" . }} 6 |

7 | {{ .Title }} 8 | {{- if .Draft }} 9 | 10 | 11 | 13 | 14 | 15 | {{- end }} 16 |

17 | {{- if .Description }} 18 |
19 | {{ .Description }} 20 |
21 | {{- end }} 22 | {{- if not (.Param "hideMeta") }} 23 | 29 | 32 | {{- end }} 33 |
34 | {{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }} 35 | {{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }} 36 | {{- if (.Param "ShowToc") }} 37 | {{- partial "toc.html" . }} 38 | {{- end }} 39 | 40 | {{- if .Content }} 41 |
42 | {{- if not (.Param "disableAnchoredHeadings") }} 43 | {{- partial "anchored_headings.html" .Content -}} 44 | {{- else }}{{ .Content }}{{ end }} 45 |
46 | {{- end }} 47 | 48 |
49 | {{- $tags := .Language.Params.Taxonomies.tag | default "tags" }} 50 | 55 | {{- if (.Param "ShowPostNavLinks") }} 56 | {{- partial "post_nav_links.html" . }} 57 | {{- end }} 58 | {{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }} 59 | {{- partial "share_icons.html" . -}} 60 | {{- end }} 61 |
62 | 63 | {{- if (.Param "comments") }} 64 | {{- partial "comments.html" . }} 65 | {{- end }} 66 |
67 | 68 | {{- end }}{{/* end main */}} 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## WonderMod (PaperMod fork - theme for Hugo) 2 | 3 |

4 | WonderMod image 5 |

6 | 7 | ### What is this? 8 | WonderMod is a fork of a theme for [Hugo](https://gohugo.io/) called [PaperMod](https://github.com/adityatelange/hugo-PaperMod) (made by adityatelange), which is based on [Paper](https://github.com/nanxiaobei/hugo-paper/). Since PaperMod isn't interested in a few changes such as **removing inline JavaScript**, which I personally require to harden my websites, I decided to maintain my own fork (I didn't want to keep overwriting a bunch of files as a fork workflow is much cleaner). Don't expect a ton of changes, and unless you know me, you probably don't want to use WonderMod. 9 | 10 | When implementing new features, I try to do as much as I can with pure CSS code instead of adding new JavaScript code. I'd like to keep the JavaScript part minimal and that's why WonderMod should be totally usable when disabling JavaScript. WonderMod is also designed with strong CSP headers in mind: no inline JavaScript or style, no calls to third-parties. 11 | 12 | **This fork is regularly synced with upstream changes from [PaperMod](https://github.com/adityatelange/hugo-PaperMod).** A merging workflow was chosen since rebasing WonderMod's changes every time could be less efficient. As such, commit history is a bit messy, but upstream changes will be merged on a best effort basis. 13 | 14 | ### Main changes 15 | Current "main" changes are as follows: 16 | - Remove inline JavaScript 17 | - Improved YouTube shortcode 18 | - Built-in Chroma instead of client-side syntax highlighting with HLJS 19 | - Responsive Table of Contents with side display support 20 | - Responsive "hamburger" menu for mobile 21 | - Simple reading progress bar 22 | - Refactored RSS template (proper Atom feed) 23 | - Bunch of CSS and other changes 24 | 25 | ### Credits 26 | Additional credits: 27 | - [PaperModX](https://github.com/reorx/hugo-PaperModX/) by reorx 28 | 29 | ### Configure 30 | Most of the installation process and settings are shared with the original PaperMod, so check out [their documentation](https://github.com/adityatelange/hugo-PaperMod/wiki/Installation). One noticeable difference though is that in order to enable syntax highlighting, you have to add this to your `config.yml` : 31 | 32 | ``` 33 | markup: 34 | highlight: 35 | style: dracula 36 | noClasses: false 37 | guessSyntax: true 38 | ``` 39 | 40 | See [Hugo documentation](https://gohugo.io/getting-started/configuration-markup#highlight) for more options. 41 | *Note: for some reason, the `guessSyntax` doesn't actually work but is required. Please make your code fences explicit for the time being.* 42 | -------------------------------------------------------------------------------- /layouts/_default/archives.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 | 29 | 30 | {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} 31 | 32 | {{- if site.Params.ShowAllPagesInArchive }} 33 | {{- $pages = site.RegularPages }} 34 | {{- end }} 35 | 36 | {{- range $pages.GroupByPublishDate "2006" }} 37 | {{- if ne .Key "0001" }} 38 |
39 |

40 | {{- replace .Key "0001" "" }}  {{ len .Pages }} 41 |

42 | {{- range .Pages.GroupByDate "January" }} 43 |
44 |

{{- .Key }}  {{ len .Pages }}

45 |
46 | {{- range .Pages }} 47 | {{- if eq .Kind "page" }} 48 |
49 |

50 | {{- .Title | markdownify }} 51 | {{- if .Draft }} 52 | 53 | 54 | 56 | 57 | 58 | {{- end }} 59 |

60 |
61 | {{- partial "post_meta.html" . -}} 62 |
63 | 64 |
65 | {{- end }} 66 | {{- end }} 67 |
68 |
69 | {{- end }} 70 |
71 | {{- end }} 72 | {{- end }} 73 | 74 | {{- end }}{{/* end main */}} 75 | -------------------------------------------------------------------------------- /layouts/partials/cover.html: -------------------------------------------------------------------------------- 1 | {{- with .cxt}} {{/* Apply proper context from dict */}} 2 | {{- if (and .Params.cover.image (not $.isHidden)) }} 3 | {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} 4 | {{- $loading := cond $.IsSingle "eager" "lazy" }} 5 |
6 | {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} 7 | {{- $addLink := (and site.Params.cover.linkFullImages $.IsSingle) }} 8 | {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} 9 | {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} 10 | {{- $cover := (or $pageBundleCover $globalResourcesCover)}} 11 | {{- if $cover -}}{{/* i.e it is present in page bundle */}} 12 | {{- if $addLink }}{{ end -}} 14 | {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} 15 | {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} 16 | {{- if hugo.IsExtended -}} 17 | {{- $processableFormats = $processableFormats | append "webp" -}} 18 | {{- end -}} 19 | {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} 20 | {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} 21 | {{ $alt }} 28 | {{- else }}{{/* Unprocessable image or responsive images disabled */}} 29 | {{ $alt }} 30 | {{- end }} 31 | {{- else }}{{/* For absolute urls and external links, no img processing here */}} 32 | {{- if $addLink }}{{ end -}} 34 | {{ $alt }} 35 | {{- end }} 36 | {{- if $addLink }}{{ end -}} 37 | {{/* Display Caption */}} 38 | {{- if $.IsSingle }} 39 | {{ with .Params.cover.caption }}

{{ . | markdownify }}

{{- end }} 40 | {{- end }} 41 |
42 | {{- end }}{{/* End image */}} 43 | {{- end -}}{{/* End context */ -}} 44 | -------------------------------------------------------------------------------- /layouts/partials/index_profile.html: -------------------------------------------------------------------------------- 1 |
2 | {{- with site.Params.profileMode }} 3 |
4 | {{- if .imageUrl -}} 5 | {{- $img := "" }} 6 | {{- if not (urls.Parse .imageUrl).IsAbs }} 7 | {{- $img = resources.Get .imageUrl }} 8 | {{- end }} 9 | {{- if $img }} 10 | {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} 11 | {{- if hugo.IsExtended -}} 12 | {{- $processableFormats = $processableFormats | append "webp" -}} 13 | {{- end -}} 14 | {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} 15 | {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} 16 | {{- if (not (and (not .imageHeight) (not .imageWidth))) }} 17 | {{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }} 18 | {{- else if .imageHeight }} 19 | {{- $img = $img.Resize (printf "x%d" .imageHeight) }} 20 | {{ else if .imageWidth }} 21 | {{- $img = $img.Resize (printf "%dx" .imageWidth) }} 22 | {{ else }} 23 | {{- $img = $img.Resize "150x150" }} 24 | {{- end }} 25 | {{- end }} 26 | {{ .imageTitle | default 28 | {{- else }} 29 | {{ .imageTitle | default 31 | {{- end }} 32 | {{- end }} 33 |

{{ .title | default site.Title | markdownify }}

34 | {{ .subtitle | markdownify }} 35 | {{- partial "social_icons.html" -}} 36 | 37 | {{- with .buttons }} 38 | 55 | {{- end }} 56 |
57 | {{- end}} 58 |
59 | -------------------------------------------------------------------------------- /layouts/_default/rss.xml: -------------------------------------------------------------------------------- 1 | {{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} 2 | {{- $authorEmail := "" }} 3 | {{- with site.Params.author }} 4 | {{- if reflect.IsMap . }} 5 | {{- with .email }} 6 | {{- $authorEmail = . }} 7 | {{- end }} 8 | {{- end }} 9 | {{- else }} 10 | {{- with site.Author.email }} 11 | {{- $authorEmail = . }} 12 | {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} 13 | {{- end }} 14 | {{- end }} 15 | 16 | {{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} 17 | {{- $authorName := "" }} 18 | {{- with site.Params.author }} 19 | {{- if reflect.IsMap . }} 20 | {{- with .name }} 21 | {{- $authorName = . }} 22 | {{- end }} 23 | {{- else }} 24 | {{- $authorName = . }} 25 | {{- end }} 26 | {{- else }} 27 | {{- with site.Author.name }} 28 | {{- $authorName = . }} 29 | {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} 30 | {{- end }} 31 | {{- end }} 32 | 33 | {{- $pctx := . }} 34 | {{- if .IsHome }}{{ $pctx = site }}{{ end }} 35 | {{- $pages := slice }} 36 | {{- if or $.IsHome $.IsSection }} 37 | {{- $pages = $pctx.RegularPages }} 38 | {{- else }} 39 | {{- $pages = $pctx.Pages }} 40 | {{- end }} 41 | {{- $limit := site.Config.Services.RSS.Limit }} 42 | {{- if ge $limit 1 }} 43 | {{- $pages = $pages | first $limit }} 44 | {{- end }} 45 | 46 | {{- printf "" | safeHTML }} 47 | 48 | {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }} 49 | 50 | 51 | Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }} 52 | {{ .Permalink }} 53 | Hugo 54 | {{ site.Language.LanguageCode }} 55 | {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} 56 | 57 | {{ with $authorName }}{{ . }}{{ end }} 58 | {{ with $authorEmail }}{{ . }}{{ end }} 59 | 60 | {{ with site.Copyright }}{{ . }}{{ end }} 61 | 62 | {{- range $pages }} 63 | {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} 64 | 65 | {{ .Title }} 66 | 67 | {{ .Permalink }} 68 | {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} 69 | {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} 70 | {{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}} 71 | {{- if site.Params.ShowFullTextinRSS }} 72 | {{ (printf "" .Content) | safeHTML }} 73 | {{- end }} 74 | 75 | {{- end }} 76 | {{- end }} 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /layouts/partials/templates/opengraph.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{- if .Params.cover.image -}} 6 | {{- if (ne .Params.cover.relative true) }} 7 | 8 | {{- else}} 9 | 10 | {{- end}} 11 | {{- else }} 12 | 13 | {{- with $.Params.images -}} 14 | {{- range first 6 . }}{{ end -}} 15 | {{- else -}} 16 | {{- $images := $.Resources.ByType "image" -}} 17 | {{- $featured := $images.GetMatch "*feature*" -}} 18 | {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} 19 | {{- with $featured -}} 20 | 21 | {{- else -}} 22 | {{- with site.Params.images }}{{ end -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end }} 26 | 27 | {{- if .IsPage }} 28 | {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} 29 | 30 | {{ with .PublishDate }}{{ end }} 31 | {{ with .Lastmod }}{{ end }} 32 | {{- end -}} 33 | 34 | {{- with .Params.audio }}{{ end }} 35 | {{- with .Params.locale }}{{ end }} 36 | {{- with site.Params.title }}{{ end }} 37 | {{- with .Params.videos }}{{- range . }} 38 | 39 | {{ end }}{{ end }} 40 | 41 | {{- /* If it is part of a series, link to related articles */}} 42 | {{- $permalink := .Permalink }} 43 | {{- $siteSeries := site.Taxonomies.series }} 44 | {{- if $siteSeries }} 45 | {{ with .Params.series }}{{- range $name := . }} 46 | {{- $series := index $siteSeries ($name | urlize) }} 47 | {{- range $page := first 6 $series.Pages }} 48 | {{- if ne $page.Permalink $permalink }}{{ end }} 49 | {{- end }} 50 | {{ end }}{{ end }} 51 | {{- end }} 52 | 53 | {{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} 54 | {{- $facebookAdmin := "" }} 55 | {{- with site.Params.social }} 56 | {{- if reflect.IsMap . }} 57 | {{- $facebookAdmin = .facebook_admin }} 58 | {{- end }} 59 | {{- else }} 60 | {{- with site.Social.facebook_admin }} 61 | {{- $facebookAdmin = . }} 62 | {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} 63 | {{- end }} 64 | {{- end }} 65 | 66 | {{- /* Facebook Page Admin ID for Domain Insights */}} 67 | {{ with $facebookAdmin }}{{ end }} 68 | -------------------------------------------------------------------------------- /assets/js/papermod.js: -------------------------------------------------------------------------------- 1 | import * as params from '@params'; 2 | 3 | function scrollToTop() { 4 | const topButton = document.getElementById("top-link"); 5 | 6 | document.addEventListener('scroll', () => { 7 | if (document.body.scrollTop > 600 || document.documentElement.scrollTop > 600) { 8 | topButton.style.visibility = "visible"; 9 | topButton.style.opacity = "1"; 10 | } else { 11 | topButton.style.visibility = "hidden"; 12 | topButton.style.opacity = "0"; 13 | } 14 | }) 15 | } 16 | 17 | function themeToggle() { 18 | const themeButton = document.getElementById("theme-toggle"); 19 | 20 | themeButton.addEventListener("click", () => { 21 | if (document.body.className.includes("dark")) { 22 | document.body.classList.remove('dark'); 23 | localStorage.setItem("pref-theme", 'light'); 24 | } else { 25 | document.body.classList.add('dark'); 26 | localStorage.setItem("pref-theme", 'dark'); 27 | } 28 | }) 29 | } 30 | 31 | function showCodeCopyButtons() { 32 | document.querySelectorAll('pre > code').forEach((codeblock) => { 33 | const container = codeblock.parentNode.parentNode; 34 | 35 | const copybutton = document.createElement('button'); 36 | copybutton.classList.add('copy-code'); 37 | copybutton.innerHTML = 'copy'; 38 | 39 | function copyingDone() { 40 | copybutton.innerHTML = 'copied!'; 41 | setTimeout(() => { 42 | copybutton.innerHTML = 'copy'; 43 | }, 2000); 44 | } 45 | 46 | copybutton.addEventListener('click', (cb) => { 47 | if ('clipboard' in navigator) { 48 | navigator.clipboard.writeText(codeblock.textContent); 49 | copyingDone(); 50 | return; 51 | } 52 | 53 | const range = document.createRange(); 54 | range.selectNodeContents(codeblock); 55 | const selection = window.getSelection(); 56 | selection.removeAllRanges(); 57 | selection.addRange(range); 58 | try { 59 | document.execCommand('copy'); 60 | copyingDone(); 61 | } catch (e) { }; 62 | selection.removeRange(range); 63 | }); 64 | 65 | if (container.classList.contains("highlight")) { 66 | container.appendChild(copybutton); 67 | } else if (container.parentNode.firstChild == container) { 68 | // td containing LineNos 69 | } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") { 70 | // table containing LineNos and code 71 | codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton); 72 | } else { 73 | // code blocks not having highlight as parent class 74 | codeblock.parentNode.appendChild(copybutton); 75 | } 76 | }); 77 | } 78 | 79 | function openToc() { 80 | const toc = document.getElementById("toc"); 81 | 82 | if (!toc) return; 83 | 84 | if (window.innerWidth > 1500 && window.innerHeight > 800) { 85 | toc.open = true; 86 | } 87 | } 88 | 89 | function progressBar() { 90 | const bar = document.getElementById("progressBar"); 91 | 92 | if (!bar) return; 93 | 94 | document.addEventListener('scroll', () => { 95 | let scrollPercent = document.documentElement.scrollTop / (document.documentElement.scrollHeight - window.innerHeight) * 100; 96 | if (scrollPercent >= 99) { scrollPercent = 0 }; 97 | bar.style.setProperty("--scrollAmount", scrollPercent + '%'); 98 | }) 99 | } 100 | 101 | 102 | if (params.scrollToTop) scrollToTop(); 103 | if (params.themeToggle) themeToggle(); 104 | if (params.showCodeCopyButtons) showCodeCopyButtons(); 105 | openToc(); 106 | progressBar(); -------------------------------------------------------------------------------- /assets/css/common/header.css: -------------------------------------------------------------------------------- 1 | .nav { 2 | display: flex; 3 | flex-wrap: wrap; 4 | justify-content: space-between; 5 | max-width: calc(var(--nav-width) + var(--gap) * 2); 6 | margin-inline-start: auto; 7 | margin-inline-end: auto; 8 | line-height: var(--header-height); 9 | } 10 | 11 | .nav a { 12 | display: block; 13 | } 14 | 15 | .logo, 16 | #menu { 17 | display: flex; 18 | margin: auto var(--gap); 19 | } 20 | 21 | .logo { 22 | flex-wrap: inherit; 23 | } 24 | 25 | .logo a { 26 | font-size: 24px; 27 | font-weight: 700; 28 | } 29 | 30 | .logo a img, .logo a svg { 31 | display: inline; 32 | vertical-align: middle; 33 | pointer-events: none; 34 | transform: translate(0, -10%); 35 | border-radius: 6px; 36 | margin-inline-end: 8px; 37 | } 38 | 39 | button#theme-toggle { 40 | font-size: 26px; 41 | margin: auto 4px; 42 | } 43 | 44 | body.dark #moon { 45 | vertical-align: middle; 46 | display: none; 47 | } 48 | 49 | body:not(.dark) #sun { 50 | display: none; 51 | } 52 | 53 | #menu { 54 | list-style: none; 55 | word-break: keep-all; 56 | overflow-x: auto; 57 | white-space: nowrap; 58 | } 59 | 60 | #menu li + li { 61 | margin-inline-start: var(--gap); 62 | } 63 | 64 | #hamburger-input { 65 | display: none; 66 | } 67 | 68 | #hamburger-menu { 69 | display: none; 70 | width: 18px; 71 | height: 18px; 72 | margin: auto; 73 | margin-right: 13px; 74 | margin-left: 13px; 75 | background: linear-gradient( 76 | var(--primary), var(--primary) 20%, 77 | #ffffff00 20%, #ffffff00 40%, 78 | var(--primary) 40%, var(--primary) 60%, 79 | #ffffff00 60%, #ffffff00 80%, 80 | var(--primary) 80%, var(--primary) 100% 81 | ); 82 | z-index: 10001; 83 | cursor: pointer; 84 | } 85 | 86 | @media screen and (max-width: 900px) { 87 | #menu { 88 | display: none; 89 | } 90 | 91 | #hamburger-menu { 92 | display: inline; 93 | } 94 | 95 | #hamburger-input:checked ~ #hamburger-menu { 96 | background: none; 97 | } 98 | 99 | #hamburger-input:checked ~ #hamburger-menu:after { 100 | content: "\00d7"; 101 | position: fixed; 102 | font-size: 28px; 103 | line-height: 0; 104 | top: 28px; 105 | } 106 | 107 | #hamburger-input:checked ~ .overlay { 108 | visibility: visible; 109 | } 110 | 111 | #hamburger-input:checked ~ #menu { 112 | display: block; 113 | width: 80%; 114 | margin: auto; 115 | position: fixed; 116 | top: 50%; 117 | left: 50%; 118 | margin-right: -50%; 119 | transform: translate(-50%, -50%); 120 | z-index: 10002; 121 | } 122 | 123 | #menu li { 124 | text-align: center; 125 | } 126 | 127 | #menu li + li { 128 | margin-inline-start: 0; 129 | } 130 | } 131 | 132 | .overlay { 133 | position: fixed; 134 | top: 0; 135 | left: 0; 136 | width: 100%; 137 | height: 100%; 138 | visibility: hidden; 139 | overflow: hidden; 140 | background: var(--theme); 141 | z-index: 10000; 142 | } 143 | 144 | #menu a { 145 | font-size: 16px; 146 | } 147 | 148 | #menu .active { 149 | font-weight: 500; 150 | border-bottom: 2px solid currentColor; 151 | } 152 | 153 | .lang-switch li, 154 | .lang-switch ul, 155 | .logo-switches { 156 | display: inline-flex; 157 | margin: auto 4px; 158 | } 159 | 160 | .lang-switch { 161 | display: flex; 162 | flex-wrap: inherit; 163 | } 164 | 165 | .lang-switch a { 166 | margin: auto 3px; 167 | font-size: 16px; 168 | font-weight: 500; 169 | } 170 | 171 | .logo-switches { 172 | flex-wrap: inherit; 173 | } 174 | 175 | #progressBar { 176 | --scrollAmount: 0%; 177 | width: var(--scrollAmount); 178 | height: 3px; 179 | background-color: #1e8cdb; 180 | position: fixed; 181 | z-index: 9999; 182 | } -------------------------------------------------------------------------------- /layouts/partials/templates/schema_json.html: -------------------------------------------------------------------------------- 1 | {{ if .IsHome }} 2 | 19 | {{- else if (or .IsPage .IsSection) }} 20 | {{/* BreadcrumbList */}} 21 | {{- $url := replace .Parent.Permalink ( printf "%s" site.BaseURL) "" }} 22 | {{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} 23 | {{- $bc_list := (split $lang_url "/")}} 24 | 25 | {{- $scratch := newScratch }} 26 | 58 | {{- if .IsPage }} 59 | 117 | {{- end }}{{/* .IsPage end */}} 118 | 119 | {{- end -}} 120 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 | {{- if (and site.Params.profileMode.enabled .IsHome) }} 4 | {{- partial "index_profile.html" . }} 5 | {{- else }} {{/* if not profileMode */}} 6 | 7 | {{- if not .IsHome | and .Title }} 8 | 31 | {{- end }} 32 | 33 | {{- if .Content }} 34 |
35 | {{- if not (.Param "disableAnchoredHeadings") }} 36 | {{- partial "anchored_headings.html" .Content -}} 37 | {{- else }}{{ .Content }}{{ end }} 38 |
39 | {{- end }} 40 | 41 | {{- $pages := union .RegularPages .Sections }} 42 | 43 | {{- if .IsHome }} 44 | {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} 45 | {{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} 46 | {{- end }} 47 | 48 | {{- $paginator := .Paginate $pages }} 49 | 50 | {{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} 51 | {{- partial "home_info.html" . }} 52 | {{- end }} 53 | 54 | {{- $term := .Data.Term }} 55 | {{- range $index, $page := $paginator.Pages }} 56 | 57 | {{- $class := "post-entry" }} 58 | 59 | {{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} 60 | {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} 61 | {{- $class = "first-entry" }} 62 | {{- else if $term }} 63 | {{- $class = "post-entry tag-entry" }} 64 | {{- end }} 65 | 66 |
67 | {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} 68 | {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }} 69 |
70 |

71 | {{- .Title }} 72 | {{- if .Draft }} 73 | 74 | 75 | 77 | 78 | 79 | {{- end }} 80 |

81 |
82 | {{- if (ne (.Param "hideSummary") true) }} 83 |
84 |

{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}

85 |
86 | {{- end }} 87 | {{- if not (.Param "hideMeta") }} 88 |
89 | {{- partial "post_meta.html" . -}} 90 |
91 | {{- end }} 92 | 93 |
94 | {{- end }} 95 | 96 | {{- if gt $paginator.TotalPages 1 }} 97 | 117 | {{- end }} 118 | 119 | {{- end }}{{/* end profileMode */}} 120 | 121 | {{- end }}{{- /* end main */ -}} 122 | -------------------------------------------------------------------------------- /assets/css/common/chroma.css: -------------------------------------------------------------------------------- 1 | /* Background */ .chroma { color: #f8f8f2; background-color: #282a36 } 2 | /* Other */ .chroma .x { } 3 | /* Error */ .chroma .err { } 4 | /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } 5 | /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 20px; border: 0; width: auto; overflow: auto; display: block; } 6 | /* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } 7 | /* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } 8 | /* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } 9 | /* Keyword */ .chroma .k { color: #ff79c6 } 10 | /* KeywordConstant */ .chroma .kc { color: #ff79c6 } 11 | /* KeywordDeclaration */ .chroma .kd { color: #8be9fd; font-style: italic } 12 | /* KeywordNamespace */ .chroma .kn { color: #ff79c6 } 13 | /* KeywordPseudo */ .chroma .kp { color: #ff79c6 } 14 | /* KeywordReserved */ .chroma .kr { color: #ff79c6 } 15 | /* KeywordType */ .chroma .kt { color: #8be9fd } 16 | /* Name */ .chroma .n { } 17 | /* NameAttribute */ .chroma .na { color: #50fa7b } 18 | /* NameBuiltin */ .chroma .nb { color: #8be9fd; font-style: italic } 19 | /* NameBuiltinPseudo */ .chroma .bp { } 20 | /* NameClass */ .chroma .nc { color: #50fa7b } 21 | /* NameConstant */ .chroma .no { } 22 | /* NameDecorator */ .chroma .nd { } 23 | /* NameEntity */ .chroma .ni { } 24 | /* NameException */ .chroma .ne { } 25 | /* NameFunction */ .chroma .nf { color: #50fa7b } 26 | /* NameFunctionMagic */ .chroma .fm { } 27 | /* NameLabel */ .chroma .nl { color: #8be9fd; font-style: italic } 28 | /* NameNamespace */ .chroma .nn { } 29 | /* NameOther */ .chroma .nx { } 30 | /* NameProperty */ .chroma .py { } 31 | /* NameTag */ .chroma .nt { color: #ff79c6 } 32 | /* NameVariable */ .chroma .nv { color: #8be9fd; font-style: italic } 33 | /* NameVariableClass */ .chroma .vc { color: #8be9fd; font-style: italic } 34 | /* NameVariableGlobal */ .chroma .vg { color: #8be9fd; font-style: italic } 35 | /* NameVariableInstance */ .chroma .vi { color: #8be9fd; font-style: italic } 36 | /* NameVariableMagic */ .chroma .vm { } 37 | /* Literal */ .chroma .l { } 38 | /* LiteralDate */ .chroma .ld { } 39 | /* LiteralString */ .chroma .s { color: #f1fa8c } 40 | /* LiteralStringAffix */ .chroma .sa { color: #f1fa8c } 41 | /* LiteralStringBacktick */ .chroma .sb { color: #f1fa8c } 42 | /* LiteralStringChar */ .chroma .sc { color: #f1fa8c } 43 | /* LiteralStringDelimiter */ .chroma .dl { color: #f1fa8c } 44 | /* LiteralStringDoc */ .chroma .sd { color: #f1fa8c } 45 | /* LiteralStringDouble */ .chroma .s2 { color: #f1fa8c } 46 | /* LiteralStringEscape */ .chroma .se { color: #f1fa8c } 47 | /* LiteralStringHeredoc */ .chroma .sh { color: #f1fa8c } 48 | /* LiteralStringInterpol */ .chroma .si { color: #f1fa8c } 49 | /* LiteralStringOther */ .chroma .sx { color: #f1fa8c } 50 | /* LiteralStringRegex */ .chroma .sr { color: #f1fa8c } 51 | /* LiteralStringSingle */ .chroma .s1 { color: #f1fa8c } 52 | /* LiteralStringSymbol */ .chroma .ss { color: #f1fa8c } 53 | /* LiteralNumber */ .chroma .m { color: #bd93f9 } 54 | /* LiteralNumberBin */ .chroma .mb { color: #bd93f9 } 55 | /* LiteralNumberFloat */ .chroma .mf { color: #bd93f9 } 56 | /* LiteralNumberHex */ .chroma .mh { color: #bd93f9 } 57 | /* LiteralNumberInteger */ .chroma .mi { color: #bd93f9 } 58 | /* LiteralNumberIntegerLong */ .chroma .il { color: #bd93f9 } 59 | /* LiteralNumberOct */ .chroma .mo { color: #bd93f9 } 60 | /* Operator */ .chroma .o { color: #ff79c6 } 61 | /* OperatorWord */ .chroma .ow { color: #ff79c6 } 62 | /* Punctuation */ .chroma .p { } 63 | /* Comment */ .chroma .c { color: #6272a4 } 64 | /* CommentHashbang */ .chroma .ch { color: #6272a4 } 65 | /* CommentMultiline */ .chroma .cm { color: #6272a4 } 66 | /* CommentSingle */ .chroma .c1 { color: #6272a4 } 67 | /* CommentSpecial */ .chroma .cs { color: #6272a4 } 68 | /* CommentPreproc */ .chroma .cp { color: #ff79c6 } 69 | /* CommentPreprocFile */ .chroma .cpf { color: #ff79c6 } 70 | /* Generic */ .chroma .g { } 71 | /* GenericDeleted */ .chroma .gd { color: #ff5555 } 72 | /* GenericEmph */ .chroma .ge { text-decoration: underline } 73 | /* GenericError */ .chroma .gr { } 74 | /* GenericHeading */ .chroma .gh { font-weight: bold } 75 | /* GenericInserted */ .chroma .gi { color: #50fa7b; font-weight: bold } 76 | /* GenericOutput */ .chroma .go { color: #44475a } 77 | /* GenericPrompt */ .chroma .gp { } 78 | /* GenericStrong */ .chroma .gs { } 79 | /* GenericSubheading */ .chroma .gu { font-weight: bold } 80 | /* GenericTraceback */ .chroma .gt { } 81 | /* GenericUnderline */ .chroma .gl { text-decoration: underline } 82 | /* TextWhitespace */ .chroma .w { } 83 | -------------------------------------------------------------------------------- /layouts/partials/toc.html: -------------------------------------------------------------------------------- 1 | {{- $headers := findRE "(.|\n])+?
" .Content -}} 2 | {{- $has_headers := ge (len $headers) 1 -}} 3 | {{- if $has_headers -}} 4 |
5 |
6 | 7 | {{- i18n "toc" | default "Table of Contents" }} 8 | 9 | 10 |
11 | {{- if (.Param "UseHugoToc") }} 12 | {{- .TableOfContents -}} 13 | {{- else }} 14 | {{- $largest := 6 -}} 15 | {{- range $headers -}} 16 | {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} 17 | {{- $headerLevel := len (seq $headerLevel) -}} 18 | {{- if lt $headerLevel $largest -}} 19 | {{- $largest = $headerLevel -}} 20 | {{- end -}} 21 | {{- end -}} 22 | 23 | {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} 24 | 25 | {{- $.Scratch.Set "bareul" slice -}} 26 |
    27 | {{- range seq (sub $firstHeaderLevel $largest) -}} 28 |
      29 | {{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}} 30 | {{- end -}} 31 | {{- range $i, $header := $headers -}} 32 | {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} 33 | {{- $headerLevel := len (seq $headerLevel) -}} 34 | 35 | {{/* get id="xyz" */}} 36 | {{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }} 37 | 38 | {{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}} 39 | {{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }} 40 | {{- $header := replaceRE "((.|\n])+?)" "$1" $header -}} 41 | 42 | {{- if ne $i 0 -}} 43 | {{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}} 44 | {{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}} 45 | {{- if gt $headerLevel $prevHeaderLevel -}} 46 | {{- range seq $prevHeaderLevel (sub $headerLevel 1) -}} 47 |
        48 | {{/* the first should not be recorded */}} 49 | {{- if ne $prevHeaderLevel . -}} 50 | {{- $.Scratch.Add "bareul" . -}} 51 | {{- end -}} 52 | {{- end -}} 53 | {{- else -}} 54 | 55 | {{- if lt $headerLevel $prevHeaderLevel -}} 56 | {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}} 57 | {{- if in ($.Scratch.Get "bareul") . -}} 58 |
      59 | {{/* manually do pop item */}} 60 | {{- $tmp := $.Scratch.Get "bareul" -}} 61 | {{- $.Scratch.Delete "bareul" -}} 62 | {{- $.Scratch.Set "bareul" slice}} 63 | {{- range seq (sub (len $tmp) 1) -}} 64 | {{- $.Scratch.Add "bareul" (index $tmp (sub . 1)) -}} 65 | {{- end -}} 66 | {{- else -}} 67 |
    68 | 69 | {{- end -}} 70 | {{- end -}} 71 | {{- end -}} 72 | {{- end }} 73 |
  • 74 | {{- $header | plainify | safeHTML -}} 75 | {{- else }} 76 |
  • 77 | {{- $header | plainify | safeHTML -}} 78 | {{- end -}} 79 | {{- end -}} 80 | 81 | {{- $firstHeaderLevel := $largest }} 82 | {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) }} 83 |
  • 84 | {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}} 85 | {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) }} 86 |
87 | {{- else }} 88 | 89 | 90 | {{- end -}} 91 | {{- end }} 92 | 93 | {{- end }} 94 |
95 |
96 |
97 | {{- end }} 98 | -------------------------------------------------------------------------------- /layouts/partials/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) }} 5 | 6 | {{- else }} 7 | 8 | {{- end }} 9 | 10 | {{- /* Title */}} 11 | {{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ site.Title }} 12 | 13 | {{- /* Meta */}} 14 | {{- if .IsHome }} 15 | {{ with site.Params.keywords -}}{{ end }} 16 | {{- else }} 17 | 20 | {{- end }} 21 | 24 | 25 | 26 | {{- if site.Params.analytics.google.SiteVerificationTag }} 27 | 28 | {{- end }} 29 | {{- if site.Params.analytics.yandex.SiteVerificationTag }} 30 | 31 | {{- end }} 32 | {{- if site.Params.analytics.bing.SiteVerificationTag }} 33 | 34 | {{- end }} 35 | {{- if site.Params.analytics.naver.SiteVerificationTag }} 36 | 37 | {{- end }} 38 | 39 | {{- /* Styles */}} 40 | 41 | {{- /* includes */}} 42 | {{- $includes := slice }} 43 | {{- $includes = $includes | append (" " | resources.FromString "assets/css/includes-blank.css")}} 44 | 45 | {{- if not (eq site.Params.assets.disableScrollBarStyle true) }} 46 | {{- $ScrollStyle := (resources.Get "css/includes/scroll-bar.css") }} 47 | {{- $includes = (append $ScrollStyle $includes) }} 48 | {{- end }} 49 | 50 | {{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} 51 | 52 | {{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} 53 | {{- $reset := (resources.Get "css/core/reset.css") }} 54 | {{- $media := (resources.Get "css/core/zmedia.css") }} 55 | {{- $license_css := (resources.Get "css/core/license.css") }} 56 | {{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} 57 | {{- $commonHighlight := (resources.Get "css/common/chroma.css") }} 58 | 59 | {{- /* order is important */}} 60 | {{- $core := (slice $theme_vars $reset $common $includes_all $media) | resources.Concat "assets/css/core.css" | resources.Minify }} 61 | {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" | resources.Minify }} 62 | 63 | {{- /* bundle all required css */}} 64 | {{- /* Add extended css after theme style */ -}} 65 | {{- $stylesheet := (slice $license_css $core $extended) | resources.Concat "assets/css/stylesheet.css" }} 66 | 67 | {{- if not site.Params.assets.disableFingerprinting }} 68 | {{- $stylesheet := $stylesheet | fingerprint }} 69 | 70 | {{- else }} 71 | 72 | {{- end }} 73 | 74 | {{- /* noscript */}} 75 | 84 | 85 | {{- /* Favicons */}} 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | {{- /* RSS */}} 95 | {{ range .AlternativeOutputFormats -}} 96 | 97 | {{ end -}} 98 | {{- range .AllTranslations -}} 99 | 100 | {{ end -}} 101 | 102 | {{- partial "extend_head.html" . -}} 103 | 104 | {{- /* Misc */}} 105 | {{- if hugo.IsProduction | or (eq site.Params.env "production") }} 106 | {{- template "_internal/google_analytics.html" . }} 107 | {{- template "partials/templates/opengraph.html" . }} 108 | {{- template "partials/templates/twitter_cards.html" . }} 109 | {{- template "partials/templates/schema_json.html" . }} 110 | {{- end -}} 111 | -------------------------------------------------------------------------------- /assets/js/fastsearch.js: -------------------------------------------------------------------------------- 1 | import * as params from '@params'; 2 | 3 | let fuse; // holds our search engine 4 | let resList = document.getElementById('searchResults'); 5 | let sInput = document.getElementById('searchInput'); 6 | let first, last, current_elem = null 7 | let resultsAvailable = false; 8 | 9 | // load our search index 10 | window.onload = function () { 11 | let xhr = new XMLHttpRequest(); 12 | xhr.onreadystatechange = function () { 13 | if (xhr.readyState === 4) { 14 | if (xhr.status === 200) { 15 | let data = JSON.parse(xhr.responseText); 16 | if (data) { 17 | // fuse.js options; check fuse.js website for details 18 | let options = { 19 | distance: 100, 20 | threshold: 0.4, 21 | ignoreLocation: true, 22 | keys: [ 23 | 'title', 24 | 'permalink', 25 | 'summary', 26 | 'content' 27 | ] 28 | }; 29 | if (params.fuseOpts) { 30 | options = { 31 | isCaseSensitive: params.fuseOpts.iscasesensitive ?? false, 32 | includeScore: params.fuseOpts.includescore ?? false, 33 | includeMatches: params.fuseOpts.includematches ?? false, 34 | minMatchCharLength: params.fuseOpts.minmatchcharlength ?? 1, 35 | shouldSort: params.fuseOpts.shouldsort ?? true, 36 | findAllMatches: params.fuseOpts.findallmatches ?? false, 37 | keys: params.fuseOpts.keys ?? ['title', 'permalink', 'summary', 'content'], 38 | location: params.fuseOpts.location ?? 0, 39 | threshold: params.fuseOpts.threshold ?? 0.4, 40 | distance: params.fuseOpts.distance ?? 100, 41 | ignoreLocation: params.fuseOpts.ignorelocation ?? true 42 | } 43 | } 44 | fuse = new Fuse(data, options); // build the index from the json file 45 | } 46 | } else { 47 | console.log(xhr.responseText); 48 | } 49 | } 50 | }; 51 | xhr.open('GET', "../index.json"); 52 | xhr.send(); 53 | } 54 | 55 | function activeToggle(ae) { 56 | document.querySelectorAll('.focus').forEach(function (element) { 57 | // rm focus class 58 | element.classList.remove("focus") 59 | }); 60 | if (ae) { 61 | ae.focus() 62 | document.activeElement = current_elem = ae; 63 | ae.parentElement.classList.add("focus") 64 | } else { 65 | document.activeElement.parentElement.classList.add("focus") 66 | } 67 | } 68 | 69 | function reset() { 70 | resultsAvailable = false; 71 | resList.innerHTML = sInput.value = ''; // clear inputbox and searchResults 72 | sInput.focus(); // shift focus to input box 73 | } 74 | 75 | // execute search as each character is typed 76 | sInput.onkeyup = function (e) { 77 | // run a search query (for "term") every time a letter is typed 78 | // in the search box 79 | if (fuse) { 80 | let results; 81 | if (params.fuseOpts) { 82 | results = fuse.search(this.value.trim(), {limit: params.fuseOpts.limit}); // the actual query being run using fuse.js along with options 83 | } else { 84 | results = fuse.search(this.value.trim()); // the actual query being run using fuse.js 85 | } 86 | if (results.length !== 0) { 87 | // build our html if result exists 88 | let resultSet = ''; // our results bucket 89 | 90 | for (let item in results) { 91 | resultSet += `
  • ${results[item].item.title} »
    ` + 92 | `
  • ` 93 | } 94 | 95 | resList.innerHTML = resultSet; 96 | resultsAvailable = true; 97 | first = resList.firstChild; 98 | last = resList.lastChild; 99 | } else { 100 | resultsAvailable = false; 101 | resList.innerHTML = ''; 102 | } 103 | } 104 | } 105 | 106 | sInput.addEventListener('search', function (e) { 107 | // clicked on x 108 | if (!this.value) reset() 109 | }) 110 | 111 | // kb bindings 112 | document.onkeydown = function (e) { 113 | let key = e.key; 114 | let ae = document.activeElement; 115 | 116 | let inbox = document.getElementById("searchbox").contains(ae) 117 | 118 | if (ae === sInput) { 119 | let elements = document.getElementsByClassName('focus'); 120 | while (elements.length > 0) { 121 | elements[0].classList.remove('focus'); 122 | } 123 | } else if (current_elem) ae = current_elem; 124 | 125 | if (key === "Escape") { 126 | reset() 127 | } else if (!resultsAvailable || !inbox) { 128 | return 129 | } else if (key === "ArrowDown") { 130 | e.preventDefault(); 131 | if (ae == sInput) { 132 | // if the currently focused element is the search input, focus the of first
  • 133 | activeToggle(resList.firstChild.lastChild); 134 | } else if (ae.parentElement != last) { 135 | // if the currently focused element's parent is last, do nothing 136 | // otherwise select the next search result 137 | activeToggle(ae.parentElement.nextSibling.lastChild); 138 | } 139 | } else if (key === "ArrowUp") { 140 | e.preventDefault(); 141 | if (ae.parentElement == first) { 142 | // if the currently focused element is first item, go to input box 143 | activeToggle(sInput); 144 | } else if (ae != sInput) { 145 | // if the currently focused element is input box, do nothing 146 | // otherwise select the previous search result 147 | activeToggle(ae.parentElement.previousSibling.lastChild); 148 | } 149 | } else if (key === "ArrowRight") { 150 | ae.click(); // click on active link 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | {{- /* theme.js */}} 2 | {{- if not site.Params.disableThemeToggle }} 3 | {{- $theme := resources.Get "js/theme.js" | resources.Minify }} 4 | {{- if not site.Params.assets.disableFingerprinting }} 5 | {{- $theme_js := (slice $theme) | resources.Concat "assets/js/theme.js" | fingerprint }} 6 | 7 | {{- else }} 8 | {{- $theme_js := (slice $theme) | resources.Concat "assets/js/theme.js" }} 9 | 10 | {{- end }} 11 | {{- end }} 12 | 13 |
    14 | {{- if ( and (.IsPage) (ne .Layout "archives") (ne .Layout "search")) }} 15 |
    16 | {{- end }} 17 |
    126 |
    127 | -------------------------------------------------------------------------------- /assets/css/common/post-single.css: -------------------------------------------------------------------------------- 1 | .page-header, 2 | .post-header { 3 | margin: 24px auto var(--content-gap) auto; 4 | } 5 | 6 | .post-title { 7 | margin-bottom: 2px; 8 | font-size: 40px; 9 | } 10 | 11 | .post-description { 12 | margin-top: 10px; 13 | margin-bottom: 5px; 14 | } 15 | 16 | .post-meta, 17 | .breadcrumbs { 18 | color: var(--secondary); 19 | font-size: 14px; 20 | display: flex; 21 | flex-wrap: wrap; 22 | } 23 | 24 | .post-meta .i18n_list li { 25 | display: inline-flex; 26 | list-style: none; 27 | margin: auto 3px; 28 | box-shadow: 0 1px 0 var(--secondary); 29 | } 30 | 31 | .breadcrumbs a { 32 | font-size: 16px; 33 | } 34 | 35 | .post-content { 36 | color: var(--content); 37 | } 38 | 39 | .post-content h3, 40 | .post-content h4, 41 | .post-content h5, 42 | .post-content h6 { 43 | margin: 24px 0 16px; 44 | } 45 | 46 | .post-content h1 { 47 | margin: 40px auto 32px; 48 | font-size: 40px; 49 | } 50 | 51 | .post-content h2 { 52 | margin: 32px auto 24px; 53 | font-size: 32px; 54 | } 55 | 56 | .post-content h3 { 57 | font-size: 24px; 58 | } 59 | 60 | .post-content h4 { 61 | font-size: 16px; 62 | } 63 | 64 | .post-content h5 { 65 | font-size: 14px; 66 | } 67 | 68 | .post-content h6 { 69 | font-size: 12px; 70 | } 71 | 72 | .post-content a, 73 | .toc a:hover { 74 | border-bottom: 1px solid var(--primary); 75 | } 76 | 77 | .post-content a code { 78 | margin: auto 0; 79 | border-radius: 0; 80 | box-shadow: 0 -1px 0 var(--primary) inset; 81 | } 82 | 83 | .post-content del { 84 | text-decoration: line-through; 85 | } 86 | 87 | .post-content dl, 88 | .post-content ol, 89 | .post-content p, 90 | .post-content figure, 91 | .post-content ul { 92 | margin-bottom: var(--content-gap); 93 | } 94 | 95 | .post-content ol, 96 | .post-content ul { 97 | padding-inline-start: 20px; 98 | } 99 | 100 | .post-content li { 101 | margin-top: 5px; 102 | } 103 | 104 | .post-content li p { 105 | margin-bottom: 0; 106 | } 107 | 108 | .post-content dl { 109 | display: flex; 110 | flex-wrap: wrap; 111 | margin: 0; 112 | } 113 | 114 | .post-content dt { 115 | width: 25%; 116 | font-weight: 700; 117 | } 118 | 119 | .post-content dd { 120 | width: 75%; 121 | margin-inline-start: 0; 122 | padding-inline-start: 10px; 123 | } 124 | 125 | .post-content dd ~ dd, 126 | .post-content dt ~ dt { 127 | margin-top: 10px; 128 | } 129 | 130 | .post-content table { 131 | margin-bottom: var(--content-gap); 132 | } 133 | 134 | .post-content table th, 135 | .post-content table:not(.highlighttable, .highlight table, .gist .highlight) td { 136 | min-width: 80px; 137 | padding: 8px 5px; 138 | line-height: 1.5; 139 | border-bottom: 1px solid var(--border); 140 | } 141 | 142 | .post-content table th { 143 | text-align: start; 144 | } 145 | 146 | .post-content table:not(.highlighttable) td code:only-child { 147 | margin: auto 0; 148 | } 149 | 150 | .post-content .highlight table { 151 | border-radius: var(--radius); 152 | } 153 | 154 | .post-content .highlight:not(table) { 155 | margin: 10px auto; 156 | border-radius: var(--radius); 157 | direction: ltr; 158 | } 159 | 160 | .post-content li > .highlight { 161 | margin-inline-end: 0; 162 | } 163 | 164 | .post-content ul pre { 165 | margin-inline-start: calc(var(--gap) * -2); 166 | } 167 | 168 | .post-content .highlight pre { 169 | margin: 0; 170 | } 171 | 172 | .post-content .highlighttable { 173 | table-layout: fixed; 174 | } 175 | 176 | .post-content .highlighttable td:first-child { 177 | width: 40px; 178 | } 179 | 180 | .post-content .highlighttable td .linenodiv { 181 | padding-inline-end: 0 !important; 182 | } 183 | 184 | .post-content .highlighttable td .highlight, 185 | .post-content .highlighttable td .linenodiv pre { 186 | margin-bottom: 0; 187 | } 188 | 189 | .post-content .highlighttable td .highlight pre code::-webkit-scrollbar { 190 | display: none; 191 | } 192 | 193 | /* code block */ 194 | .post-content .chroma { 195 | border-radius: var(--radius); 196 | } 197 | 198 | .post-content code { 199 | /* inline code */ 200 | background-color: var(--tertiary); 201 | margin: auto 4px; 202 | padding: 4px 6px; 203 | font-size: 0.78em; 204 | line-height: 1.5; 205 | border-radius: 4px; 206 | } 207 | 208 | .post-content pre code { 209 | /* reset inline code */ 210 | background-color: unset; 211 | display: block; 212 | margin: 20px; 213 | padding: 10px; 214 | overflow-x: auto; 215 | word-break: break-all; 216 | } 217 | 218 | .post-content .chroma code { 219 | background-color: inherit; 220 | } 221 | 222 | .post-content blockquote { 223 | margin: 20px 0; 224 | padding: 0 14px; 225 | border-inline-start: 3px solid var(--primary); 226 | } 227 | 228 | .post-content hr { 229 | margin: 30px 0; 230 | height: 2px; 231 | background: var(--tertiary); 232 | border: 0; 233 | } 234 | 235 | .post-content iframe { 236 | max-width: 100%; 237 | } 238 | 239 | .post-content img { 240 | border-radius: 4px; 241 | margin: 1rem 0; 242 | } 243 | 244 | .post-content img[src*="#center"] { 245 | margin: 1rem auto; 246 | } 247 | 248 | .post-content figure.align-center { 249 | text-align: center; 250 | } 251 | 252 | .post-content figure > figcaption { 253 | color: var(--primary); 254 | font-size: 16px; 255 | font-weight: bold; 256 | margin: 8px 0 16px; 257 | } 258 | 259 | .post-content figure > figcaption > p { 260 | color: var(--secondary); 261 | font-size: 14px; 262 | font-weight: normal; 263 | } 264 | 265 | .toc { 266 | margin: 0 2px 40px 2px; 267 | border: 1px solid var(--border); 268 | background: var(--tertiary); 269 | border-radius: var(--radius); 270 | padding: 0.4em; 271 | } 272 | 273 | @media screen and (min-width: 1400px) { 274 | .toc.side { 275 | position: fixed; 276 | right: 30px; 277 | top: 100px; 278 | width: 300px; 279 | font-size: .9em; 280 | max-height: calc(100% - 150px); 281 | overflow: auto; 282 | } 283 | } 284 | 285 | .dark .toc { 286 | background: var(--entry); 287 | } 288 | 289 | .toc details summary { 290 | cursor: pointer; 291 | margin-inline-start: 20px; 292 | } 293 | 294 | .toc .details { 295 | display: inline; 296 | font-weight: 500; 297 | } 298 | 299 | .toc .inner { 300 | margin: 0 20px; 301 | padding: 10px 20px; 302 | } 303 | 304 | .toc li ul { 305 | margin-inline-start: var(--gap); 306 | } 307 | 308 | .toc summary:focus { 309 | outline: 0; 310 | } 311 | 312 | .post-footer { 313 | margin-top: 56px; 314 | } 315 | 316 | .post-footer>* { 317 | margin-bottom: 10px; 318 | } 319 | 320 | .post-tags { 321 | display: flex; 322 | flex-wrap: wrap; 323 | gap: 10px; 324 | } 325 | 326 | .post-tags li { 327 | display: inline-block; 328 | } 329 | 330 | .post-tags a, 331 | .paginav { 332 | border-radius: var(--radius); 333 | background: var(--code-bg); 334 | border: 1px solid var(--border); 335 | } 336 | 337 | .post-tags a { 338 | display: block; 339 | padding: 0 14px; 340 | color: var(--secondary); 341 | font-size: 14px; 342 | line-height: 34px; 343 | background: var(--tertiary); 344 | } 345 | 346 | .share-buttons { 347 | padding: 10px; 348 | display: flex; 349 | justify-content: center; 350 | overflow-x: auto; 351 | gap: 10px; 352 | } 353 | 354 | .share-buttons li, 355 | .share-buttons a { 356 | display: inline-flex; 357 | } 358 | 359 | .share-buttons a:not(:last-of-type) { 360 | margin-inline-end: 12px; 361 | } 362 | 363 | h1:hover .anchor, 364 | h2:hover .anchor, 365 | h3:hover .anchor, 366 | h4:hover .anchor, 367 | h5:hover .anchor, 368 | h6:hover .anchor { 369 | border-bottom: none; 370 | display: inline-flex; 371 | color: var(--secondary); 372 | margin-inline-start: 8px; 373 | font-weight: 500; 374 | user-select: none; 375 | } 376 | 377 | .paginav { 378 | display: flex; 379 | line-height: 30px; 380 | border-radius: var(--radius); 381 | background: none; 382 | border: none; 383 | } 384 | 385 | .paginav a { 386 | padding-inline-start: 14px; 387 | padding-inline-end: 14px; 388 | border-radius: var(--radius); 389 | } 390 | 391 | .paginav .title { 392 | letter-spacing: 1px; 393 | text-transform: uppercase; 394 | font-size: small; 395 | color: var(--secondary); 396 | } 397 | 398 | .paginav .prev, 399 | .paginav .next { 400 | width: 50%; 401 | } 402 | 403 | .paginav span:hover:not(.title) { 404 | box-shadow: 0 1px 0; 405 | } 406 | 407 | .paginav .next { 408 | margin-inline-start: auto; 409 | text-align: right; 410 | } 411 | 412 | [dir="rtl"] .paginav .next { 413 | text-align: left; 414 | } 415 | 416 | h1>a>svg { 417 | display: inline; 418 | } 419 | 420 | img.in-text { 421 | display: inline; 422 | margin: auto; 423 | } 424 | -------------------------------------------------------------------------------- /layouts/partials/share_icons.html: -------------------------------------------------------------------------------- 1 | {{- $pageurl := .Permalink }} 2 | {{- $title := .Title }} 3 | 4 | {{- $.Scratch.Set "tags" ""}} 5 | 6 | {{- with .Params.Tags }} 7 | {{- $hashtags := newScratch}} 8 | {{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} 9 | {{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} 10 | {{- end -}} 11 | 12 | {{- $custom := false }} 13 | {{- $ShareButtons := (.Param "ShareButtons")}} 14 | {{- with $ShareButtons }}{{ $custom = true }}{{ end }} 15 | 16 | 96 | -------------------------------------------------------------------------------- /assets/js/fuse.basic.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io) 3 | * 4 | * Copyright (c) 2023 Kiro Risk (http://kiro.me) 5 | * All Rights Reserved. Apache Software License 2.0 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | */ 9 | var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?O.getFn:n,o=t.fieldNormWeight,a=void 0===o?O.fieldNormWeight:o;r(this,e),this.norm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(j).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,f(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();f(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?O.getFn:r,o=n.fieldNormWeight,a=void 0===o?O.fieldNormWeight:o,c=new A({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(x)),c.setSources(t),c.create(),c}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?O.distance:s,u=t.ignoreLocation,l=void 0===u?O.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}var F=32;function C(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?O.location:i,a=r.distance,c=void 0===a?O.distance:a,s=r.threshold,h=void 0===s?O.threshold:s,u=r.findAllMatches,l=void 0===u?O.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?O.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?O.includeMatches:v,y=r.ignoreLocation,p=void 0===y?O.ignoreLocation:y;if(t.length>F)throw new Error("Pattern length exceeds max of ".concat(F,"."));for(var m,b=t.length,k=e.length,M=Math.max(0,Math.min(o,k)),w=h,x=M,L=f>1||g,S=L?Array(k):[];(m=e.indexOf(t,x))>-1;){var _=I(t,{currentLocation:m,expectedLocation:M,distance:c,ignoreLocation:p});if(w=Math.min(_,w),x=m+b,L)for(var j=0;j=$;z-=1){var J=z-1,R=n[e.charAt(J)];if(L&&(S[J]=+!!R),K[z]=(K[z+1]<<1|1)&R,P&&(K[z]|=(A[z+1]|A[z])<<1|1|A[z+1]),K[z]&N&&(E=I(t,{errors:P,currentLocation:J,expectedLocation:M,distance:c,ignoreLocation:p}))<=w){if(w=E,(x=J)<=M)break;$=Math.max(1,2*M-x)}}if(I(t,{errors:P+1,currentLocation:M,expectedLocation:M,distance:c,ignoreLocation:p})>w)break;A=K}var U={isMatch:x>=0,score:Math.max(.001,E)};if(L){var B=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}(S,f);B.length?g&&(U.indices=B):U.isMatch=!1}return U}function N(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?O.location:o,c=i.threshold,s=void 0===c?O.threshold:c,h=i.distance,u=void 0===h?O.distance:h,l=i.includeMatches,d=void 0===l?O.includeMatches:l,f=i.findAllMatches,v=void 0===f?O.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?O.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?O.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?O.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:N(e),startIndex:t})},w=this.pattern.length;if(w>F){for(var x=0,L=w%F,S=w-L;x-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}var K=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},O),i),this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new w(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof A))throw new Error("Incorrect 'index' type");this._myIndex=t||E(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){y(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{}).limit,n=void 0===t?-1:t,r=this.options,i=r.includeMatches,o=r.includeScore,a=r.shouldSort,c=r.sortFn,s=r.ignoreFieldNorm,h=f(e)?f(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,t){var n=t.ignoreFieldNorm,r=void 0===n?O.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,i=e.norm,o=e.score,a=n?n.weight:null;t*=Math.pow(0===o&&a?Number.EPSILON:o,(a||1)*(r?1:i))})),e.score=t}))}(h,{ignoreFieldNorm:s}),a&&h.sort(c),v(n)&&n>-1&&(h=h.slice(0,n)),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?O.includeMatches:r,o=n.includeScore,a=void 0===o?O.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}(h,this._docs,{includeMatches:i,includeScore:o})}},{key:"_searchStringList",value:function(e){var t=T(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(y(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=T(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(y(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!y(n))return[];var i=[];if(u(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(y(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,h=c.score,l=c.indices;s&&i.push({score:h,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return K.version="7.0.0",K.createIndex=E,K.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?O.getFn:n,i=t.fieldNormWeight,o=void 0===i?O.fieldNormWeight:i,a=e.keys,c=e.records,s=new A({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},K.config=O,K},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); --------------------------------------------------------------------------------