Skip to content

Commit 5a4fcb4

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 2cc737d + 2dffe0b commit 5a4fcb4

File tree

16 files changed

+1136
-643
lines changed

16 files changed

+1136
-643
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- 'latest'
1212
- '0.79.0'
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
submodules: true # Fetch Hugo themes (true OR recursive)
1717
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

assets/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "{{ .Site.Title }}",
33
"short_name": "{{ .Site.Title }}",
4-
"start_url": "{{ "/" | relURL }}",
5-
"scope": "{{ "/" | relURL }}",
4+
"start_url": "{{ "./" | relURL }}",
5+
"scope": "{{ "./" | relURL }}",
66
"display": "standalone",
77
"background_color": "#000000",
88
"theme_color": "#000000",
99
"icons": [
1010
{
11-
"src": "{{ "/favicon.svg" | relURL }}",
11+
"src": "{{ "./favicon.svg" | relURL }}",
1212
"sizes": "512x512"
1313
}
1414
]

assets/plugins/_numbered.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$startLevel: 1;
22
$endLevel: 6;
33

4-
.book-page .markdown {
4+
.book-page .markdown.book-article {
55
@for $currentLevel from $startLevel through $endLevel {
66
> h#{$currentLevel} {
77
counter-increment: h#{$currentLevel};
@@ -19,7 +19,7 @@ $endLevel: 6;
1919
}
2020
}
2121

22-
.book-toc nav ul {
22+
.book-toc nav#TableOfContents ul {
2323
li {
2424
counter-increment: item;
2525

assets/sw-register.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
if (navigator.serviceWorker) {
33
navigator.serviceWorker.register(
44
"{{ $swJS.RelPermalink }}",
5-
{ scope: "{{ "/" | relURL }}" }
5+
{ scope: "{{ "./" | relURL }}" }
66
);
77
}

exampleSite/config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ enableGitInfo = true
4545

4646
[[menu.after]]
4747
name = "Hugo Themes"
48-
url = "https://themes.gohugo.io/hugo-book/"
48+
url = "https://themes.gohugo.io/themes/hugo-book/"
4949
weight = 20
5050

5151
[params]

exampleSite/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ menu:
4141
url: "https://github.com/alex-shpak/hugo-book"
4242
weight: 10
4343
- name: "Hugo Themes"
44-
url: "https://themes.gohugo.io/hugo-book/"
44+
url: "https://themes.gohugo.io/themes/hugo-book/"
4545
weight: 20
4646

4747
params:
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1+
---
2+
title: KaTeX
3+
---
14
# KaTeX
25

36
KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/)
47

58
## Example
6-
{{< columns >}}
9+
10+
<div class="book-columns flex flex-wrap">
11+
<div class="flex-even markdown-inner">
712

813
```latex
9-
{{</*/* katex [display] [class="text-center"] */*/>}}
14+
{{</* katex display=true class="optional" >}}
1015
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
11-
{{</*/* /katex */*/>}}
16+
{{< /katex */>}}
1217
```
1318

14-
<--->
19+
</div>
20+
<div class="flex-even markdown-inner">
1521

16-
{{< katex display >}}
22+
{{< katex display=true class="optional" >}}
1723
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
1824
{{< /katex >}}
1925

20-
{{< /columns >}}
26+
</div>
27+
</div>
2128

2229
## Display Mode Example
2330

2431
Here is some inline example: {{< katex >}}\pi(x){{< /katex >}}, rendered in the same line. And below is `display` example, having `display: block`
25-
{{< katex display >}}
32+
{{< katex display=true >}}
2633
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
2734
{{< /katex >}}
2835
Text continues here.

exampleSite/content.en/docs/shortcodes/mermaid.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ create a `mermaid.json` file in your `assets` folder!
1111

1212
## Example
1313

14-
{{< columns >}}
14+
15+
<div class="book-columns flex flex-wrap">
16+
<div class="flex-even markdown-inner">
17+
1518
```tpl
16-
{{</*/* mermaid [class="text-center"]*/*/>}}
19+
{{</* mermaid class="optional" >}}
1720
stateDiagram-v2
1821
State1: The state with a note
1922
note right of State1
@@ -22,12 +25,13 @@ stateDiagram-v2
2225
end note
2326
State1 --> State2
2427
note left of State2 : This is the note to the left.
25-
{{</*/* /mermaid */*/>}}
28+
{{< /mermaid */>}}
2629
```
2730

28-
<--->
31+
</div>
32+
<div class="flex-even markdown-inner">
2933

30-
{{< mermaid >}}
34+
{{< mermaid class="optional" >}}
3135
stateDiagram-v2
3236
State1: The state with a note
3337
note right of State1
@@ -38,4 +42,5 @@ stateDiagram-v2
3842
note left of State2 : This is the note to the left.
3943
{{< /mermaid >}}
4044

41-
{{< /columns >}}
45+
</div>
46+
</div>

exampleSite/content.en/menu/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ headless: true
1616
- [Columns]({{< relref "/docs/shortcodes/columns" >}})
1717
- [Expand]({{< relref "/docs/shortcodes/expand" >}})
1818
- [Hints]({{< relref "/docs/shortcodes/hints" >}})
19-
- [KaTex]({{< relref "/docs/shortcodes/katex" >}})
19+
- [KaTeX]({{< relref "/docs/shortcodes/katex" >}})
2020
- [Mermaid]({{< relref "/docs/shortcodes/mermaid" >}})
2121
- [Tabs]({{< relref "/docs/shortcodes/tabs" >}})
2222
<br />

layouts/_default/baseof.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
{{ end }}
7878

7979
{{ define "main" }}
80-
<article class="markdown">
80+
<article class="markdown book-article">
8181
{{- .Content -}}
8282
</article>
8383
{{ end }}

layouts/partials/docs/html-head.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
{{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }}
1717
<link rel="manifest" href="{{ $manifest.RelPermalink }}">
18-
<link rel="icon" href="{{ .Params.BookFavicon | default "favicon.png" | relURL }}" >
18+
<link rel="icon" href="{{ .Site.Params.BookFavicon | default "favicon.png" | relURL }}" >
19+
<link rel="canonical" href="{{ .Permalink }}">
1920

2021
{{- range .Translations }}
2122
<link rel="alternate" hreflang="{{ default .Language.Lang .Site.LanguageCode }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}">

layouts/posts/single.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ define "main" }}
2-
<article class="markdown">
2+
<article class="markdown book-post">
33
<h1>
44
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
55
</h1>

layouts/shortcodes/html.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{- .Inner -}}

layouts/shortcodes/katex.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{{- if not (.Page.Scratch.Get "katex") -}}
2-
<!-- Include katext only first time -->
2+
<!-- Include katex only first time -->
33
<link rel="stylesheet" href="{{ "katex/katex.min.css" | relURL }}" />
44
<script defer src="{{ "katex/katex.min.js" | relURL }}"></script>
55
<script defer src="{{ "katex/auto-render.min.js" | relURL }}" onload="renderMathInElement(document.body);"></script>
66
{{- .Page.Scratch.Set "katex" true -}}
77
{{- end -}}
88

99
<span {{- with .Get "class" }} class="{{ . }}"{{ end }}>
10-
{{ cond (in .Params "display") "\\[" "\\(" -}}
10+
{{ with .Get "display" }}\[{{else}}\({{end}}
1111
{{- trim .Inner "\n" -}}
12-
{{- cond (in .Params "display") "\\]" "\\)" }}
12+
{{ with .Get "display" }}\]{{else}}\){{end}}
1313
</span>

layouts/taxonomy/list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ define "main" }}
2-
<article class="markdown">
2+
<article class="markdown book-post">
33
<h1>{{ .Title | title }}</h1>
44
{{ $taxonomies := index .Site.Taxonomies .Page.Type }}
55
{{ range $taxonomies }}

static/mermaid.min.js

+1,092-613
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)