Skip to content

Latest upstream with my customizations preserved #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
800f815
fix(sidebar): hide translations selector if only one translation avai…
jamesmcmurry Feb 26, 2024
405e842
release: 3.22.0
CaiJimmy Feb 26, 2024
9bb3165
fix(sidebar): translation selector - avoid cast per PR #950 (#961)
jamesmcmurry Mar 2, 2024
f398fb9
feat(comments): add support for Beaudar(表达)comment system (#931)
hongjr03 Mar 2, 2024
65cd7f5
fix(comment): moved waline `placeholder` parameter to `locale.placeho…
L-Super Mar 2, 2024
5b0d6fd
fix(sidebar): improve accessibility of sidebar bottom menu (#925)
TheJiahao Mar 2, 2024
2f93065
release: 3.23.0
CaiJimmy Mar 2, 2024
4e7865c
fix(i18n): add missing `zh-cn` translations (#964)
fhfuih Mar 6, 2024
43224bd
feat: update Hugo version and minimum version requirement to 0.123.0 …
CaiJimmy Mar 10, 2024
4948a37
fix: `.Site.LastChange` deprecation (#968)
deining Mar 10, 2024
2cda779
feat: bump KaTeX to latest released version `0.16.9` (#969)
deining Mar 10, 2024
6c7d42d
fix(sidebar): menu-bottom-section not showing in mobile (#966)
TheJiahao Mar 10, 2024
04bf195
release: 3.24.0
CaiJimmy Mar 10, 2024
0b9f6c3
fix(head): prevent Go template from escaping HTML entities in meta de…
CaiJimmy Mar 12, 2024
eafcf89
fix: favicon does not load if baseurl includes a subfolder (#972)
delize Mar 12, 2024
5a8607e
release: 3.24.1
CaiJimmy Mar 12, 2024
2cb5ba6
fix: remove `\n` character from meta description (#980)
CaiJimmy Mar 17, 2024
b3fbe78
fix: deprecation warning for `.Site.Author` (#979)
deining Mar 17, 2024
54a8ace
release 3.24.2
CaiJimmy Mar 17, 2024
2360752
fix: use page resource permalink in link image (#990)
CaiJimmy Mar 27, 2024
b2157bd
docs: update some invalid documentation links (#983)
andrewmoise Mar 27, 2024
43e0743
feat(i18n): update translations for `ja` (#984)
sorairolake Mar 27, 2024
f8466d9
fix(i18n): wrap `footer.builtWith` with double quotes in Japanese tra…
CaiJimmy Mar 27, 2024
539c39d
feat: add anchor link to markdown heading (#992)
CaiJimmy Mar 27, 2024
797949b
fix: rename `.social-menu` to `.menu-social` to avoid being blocked b…
CaiJimmy Mar 27, 2024
609d43b
fix: make KaTeX render all math inside `document.body` (#994)
CaiJimmy Mar 27, 2024
ce798a3
release: 3.25.0
CaiJimmy Mar 27, 2024
dd193a2
Merge remote-tracking branch 'upstream/master' into dev
NapalmCodes Mar 30, 2024
79d01ea
Fix to dark mode toggle
NapalmCodes Mar 30, 2024
857e31c
Style fixes
NapalmCodes Mar 30, 2024
d1b07ec
Style fixes
NapalmCodes Mar 30, 2024
449e017
Style fix
NapalmCodes Mar 30, 2024
dbc49b9
Tweak
NapalmCodes Mar 30, 2024
e48e985
Fix
NapalmCodes Mar 30, 2024
dc844d6
Remove hash sign
NapalmCodes Mar 30, 2024
86ca3ee
Make sub heading text the anchor
NapalmCodes Mar 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://stack.jimmycai.com/).
Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://stack.jimmycai.com/guide/).
- type: textarea
id: what-happened
attributes:
Expand Down
6 changes: 4 additions & 2 deletions assets/scss/partials/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
}

/* Menu style */
.menu {
#main-menu {
padding-left: 0;
list-style: none;
flex-direction: column;
Expand All @@ -141,13 +141,15 @@
margin: 0 calc(var(--container-padding) * -1);

padding: 30px 30px;

@include respond(xl) {
padding: 15px 0;
}

&,
.menu-bottom-section {
gap: 30px;

@include respond(xl) {
gap: 25px;
}
Expand Down Expand Up @@ -210,7 +212,7 @@
}
}

.social-menu {
.menu-social {
list-style: none;
padding: 0;
margin: 0;
Expand Down
10 changes: 8 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ params:
issueTerm: pathname
label:

beaudar:
repo:
issueTerm: pathname
label:
theme:

remark42:
host:
site:
Expand All @@ -73,7 +79,7 @@ params:
clientSecret:
autoCreateIssue: false

# Waline client configuration see: https://waline.js.org/en/reference/client.html
# Waline client configuration see: https://waline.js.org/en/reference/client/props.html
waline:
serverURL:
lang:
Expand All @@ -84,9 +90,9 @@ params:
requiredMeta:
- nick
- mail
placeholder:
locale:
admin: Admin
placeholder:

twikoo:
envId:
Expand Down
12 changes: 6 additions & 6 deletions data/external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ PhotoSwipe:
type: style

KaTeX:
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css
integrity: sha256-J+iAE0sgH8QSz9hpcDxXIftnj65JEZgNhGcgReTTK9s=
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css
integrity: sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV
type: style

- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.js
integrity: sha256-InsNdER1b2xUewP+pKCUJpkhiqwHgqiPXDlIk7GzBu4=
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js
integrity: sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8
type: script
defer: true

- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/contrib/auto-render.min.js
integrity: sha256-y39Mpg7V3D4lhBX4x6O0bUqTV4pSrfgwEfGKfxkOdgI=
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js
integrity: sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05
type: script
defer: true

Expand Down
4 changes: 2 additions & 2 deletions exampleSite/content/page/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ menu:
icon: user
---

Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
Written in Go, Hugo is an open source static site generator available under the [Apache License 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.

Hugo makes use of a variety of open source projects including:

Expand All @@ -29,6 +29,6 @@ Hugo is ideal for blogs, corporate websites, creative portfolios, online magazin

Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.

Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.

Learn more and contribute on [GitHub](https://github.com/gohugoio).
10 changes: 5 additions & 5 deletions exampleSite/content/post/math-typesetting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ In this example we will be using [KaTeX](https://katex.org/)
{{ end }}
```

- To enable KaTex globally set the parameter `math` to `true` in a project's configuration
- To enable KaTex on a per page basis include the parameter `math: true` in content files
- To enable KaTeX globally set the parameter `math` to `true` in a project's configuration
- To enable KaTeX on a per page basis include the parameter `math: true` in content files

**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html)

{{< math.inline >}}
{{ if or .Page.Params.math .Site.Params.math }}
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
{{ end }}
{{</ math.inline >}}

Expand Down
8 changes: 7 additions & 1 deletion exampleSite/config.yaml → exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ params:
issueTerm: pathname
label:

beaudar:
repo:
issueTerm: pathname
label:
theme:

remark42:
host:
site:
Expand Down Expand Up @@ -205,7 +211,7 @@ params:
enabled: true

### Custom menu
### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
### See https://stack.jimmycai.com/config/menu
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu:
main: []
Expand Down
12 changes: 11 additions & 1 deletion i18n/ja.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ toggleMenu:
darkMode:
other: ダークモード

list:
page:
other: "{{ .Count }} ページ目"

section:
other: セクション

subsection:
other: サブセクション

article:
back:
other: 前のページ
Expand Down Expand Up @@ -54,7 +64,7 @@ search:

footer:
builtWith:
other: Built with {{ .Generator }}
other: "{{ .Generator }} で構築されています。"

designedBy:
other: テーマ {{ .Theme }} は {{ .DesignedBy }} によって設計されています。
9 changes: 8 additions & 1 deletion i18n/zh-cn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ toggleMenu:
darkMode:
other: 暗色模式

list:
page: "{{ .Count }} 个页面"

section: 章节

subsection: 子章节

article:
back:
other: 返回
Expand Down Expand Up @@ -54,7 +61,7 @@ search:

footer:
builtWith:
other: Built with {{ .Generator }}
other: 使用 {{ .Generator }} 构建

designedBy:
other: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计
3 changes: 3 additions & 0 deletions layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h{{ .Level }} id="{{ .Anchor }}">
<a href="#{{ .Anchor }}">{{ .Text | safeHTML }}</a>
</h{{ .Level }}>
8 changes: 4 additions & 4 deletions layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<language>{{.}}</language>{{end}}{{ with .Site.Params.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}}
Expand All @@ -35,7 +35,7 @@
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
{{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>
{{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}}
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/article/components/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ <h2 class="article-title">
</div>

{{ with $link.image }}
{{ $permalink := . }}
{{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }}
{{ $permalink = .RelPermalink }}
{{ end }}
<div class="article-image">
<img src="{{ . }}" loading="lazy">
<img src="{{ $permalink }}" loading="lazy">
</div>
{{ end }}
</a>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/article/components/math.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
<script>
window.addEventListener("DOMContentLoaded", () => {
renderMathInElement(document.querySelector(`.article-content`), {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
Expand Down
46 changes: 46 additions & 0 deletions layouts/partials/comments/provider/beaudar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script
src="https://beaudar.lipk.org/client.js"
repo="{{ .Site.Params.comments.beaudar.repo }}"
issue-term="{{ .Site.Params.comments.beaudar.issueTerm }}"
{{ with .Site.Params.comments.beaudar.label }}
label="{{ . }}"
{{ end }}
theme="{{ .Site.Params.comments.beaudar.theme }}"
crossorigin="anonymous"
async
></script>

<style>
.beaudar {
max-width: unset;
}
</style>

<script>
let beaudarLoaded = false;

function setBeaudarTheme(theme) {
let beaudar = document.querySelector(".beaudar iframe");
if (beaudar) {
beaudar.contentWindow.postMessage(
{
type: "set-theme",
theme: `github-${theme}`,
},
"https://beaudar.lipk.org"
);
}
}

addEventListener("message", (event) => {
if (event.origin !== "https://beaudar.lipk.org") return;
/// Called when Beaudar is ready
beaudarLoaded = true;
setBeaudarTheme(document.documentElement.dataset.scheme);
});

window.addEventListener("onColorSchemeChange", (e) => {
if (!beaudarLoaded) return;
setBeaudarTheme(e.detail);
});
</script>
2 changes: 1 addition & 1 deletion layouts/partials/data/description.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
{{ $description = .Summary }}
{{ end }}

{{ return ($description | plainify)}}
{{ return (replaceRE "\n" " " $description | plainify) }}
2 changes: 1 addition & 1 deletion layouts/partials/footer/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $ThemeVersion := "3.21.0" -}}
{{- $ThemeVersion := "3.25.0" -}}
<footer class="site-footer">
<section class="copyright">
&copy;
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{- end -}}

{{ with .Site.Params.favicon }}
<link rel="shortcut icon" href="{{ . }}" />
<link rel="shortcut icon" href="{{ . | relURL }}" />
{{ end }}

{{- template "_internal/google_analytics.html" . -}}
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/head/opengraph/provider/base.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- $title := partialCached "data/title" . .RelPermalink -}}
{{- $description := partialCached "data/description" . .RelPermalink -}}

<meta property='og:title' content='{{ $title }}'>
<meta property='og:description' content='{{ $description }}'>
<meta property='og:title' {{ printf "content=%q" $title | safeHTMLAttr }}>
<meta property='og:description' {{ printf "content=%q" $description | safeHTMLAttr }}>
<meta property='og:url' content='{{ .Permalink }}'>
<meta property='og:site_name' content='{{ .Site.Title }}'>
<meta property='og:type' content='
Expand Down Expand Up @@ -32,8 +32,8 @@
<meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
{{- end -}}
{{- else -}}
{{- if not .Site.LastChange.IsZero -}}
<meta property='og:updated_time' content='{{ .Site.LastChange.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
{{- if not .Site.Lastmod.IsZero -}}
<meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
{{- end -}}
{{- end -}}

Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/head/opengraph/provider/twitter.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{{- $title := partialCached "data/title" . .RelPermalink -}}
{{- $description := partialCached "data/description" . .RelPermalink -}}

<meta name="twitter:title" content="{{ $title }}">
<meta name="twitter:description" content="{{ $description }}">
<meta name="twitter:title" {{ printf "content=%q" $title | safeHTMLAttr }}>
<meta name="twitter:description" {{ printf "content=%q" $description | safeHTMLAttr }}>

{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
{{- if $image.exists -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/sidebar/left.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
</header>

{{- with .Site.Menus.social -}}
<ol class="social-menu">
<ol class="menu-social">
{{ range . }}
<li>
<a
Expand All @@ -69,7 +69,7 @@ <h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
<a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
{{ $icon := default .Pre .Params.Icon }}
{{ if .Pre }}
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }}
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://stack.jimmycai.com/config/menu" .URL }}
{{ end }}
{{ with $icon }}
{{ partial "helper/icon" . }}
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
publish = "exampleSite/public"

[build.environment]
HUGO_VERSION = "0.117.0"
HUGO_VERSION = "0.124.0"
HUGO_THEME = "repo"

[context.production]
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ features = [
"search",
]

min_version = "0.87.0"
min_version = "0.123.0"

[author]
name = "Jimmy Cai"
Expand Down