Compare commits
57 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0500942ded | ||
|
48c4e20a7d | ||
|
1fa083e0a4 | ||
|
c08222376c | ||
|
2b390c73d5 | ||
|
c9043c7fcb | ||
|
40ec45006c | ||
|
c434a66c44 | ||
|
31d741c932 | ||
|
d18fb480d3 | ||
|
6b98e015c6 | ||
|
c92d59921f | ||
|
2a6d9b31f8 | ||
|
8dc8e9ff97 | ||
|
fcd91ec6ff | ||
|
95844a6f7a | ||
|
d652a8e31c | ||
|
d9b7678e64 | ||
|
ac2950a4c0 | ||
|
422f416612 | ||
|
f53cc0573b | ||
|
9b689084a3 | ||
|
6806902501 | ||
|
cc7b31bbd0 | ||
|
0ceec0db71 | ||
|
a42dfbdbca | ||
|
793e1778cb | ||
|
d3d7541077 | ||
|
fbd7b4c939 | ||
|
0717eded21 | ||
|
1d9a2eb91a | ||
|
f5bb357b12 | ||
|
728414737c | ||
|
14d0777437 | ||
|
8e659b1110 | ||
|
2259c04f32 | ||
|
fc83e3314e | ||
|
bd3ab84db8 | ||
|
8f622b49cf | ||
|
5583510cdd | ||
|
80a6c24950 | ||
|
8c718ed668 | ||
|
a860ae9764 | ||
|
c3a7039b35 | ||
|
d27aa62d9e | ||
|
5b402c4b5d | ||
|
8c4d7defca | ||
|
6f57af9f0a | ||
|
7484d058f2 | ||
|
4f04a33623 | ||
|
b782018b8c | ||
|
f9b293c17d | ||
|
b44d2a736c | ||
|
bd0cd40fbd | ||
|
48f1064af1 | ||
|
3310c840fd | ||
|
06a4f7aceb |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
||||
public/
|
||||
public/
|
||||
.DS_Store
|
||||
|
62
README.md
62
README.md
@ -2,11 +2,23 @@
|
||||
|
||||
Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo.io/), check our [Demo](https://www.junyi.dev/).
|
||||
|
||||
> 📝 Please note that anubis2 is under active maintenance, so please REMEMBER to keep your theme up to date!
|
||||
>
|
||||
|
||||

|
||||
|
||||
| Light | Dark (Code) | Dark (Math) |
|
||||
| :------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: |
|
||||
| <img width="1166" alt="demo1" src="https://github.com/user-attachments/assets/dbdd43bc-3efe-4fdf-ab8f-f20af2cf9229"> | <img width="1112" alt="demo3" src="https://github.com/user-attachments/assets/7356ef18-00c7-44c9-91d9-0dfb9b500910"> | <img width="1166" alt="demo2" src="https://github.com/user-attachments/assets/46e19440-b054-4df9-968b-7920d74f3d80"> |
|
||||
|
||||
|
||||
> [!IMPORTANT]
|
||||
> **Update Your Blog Configuration**
|
||||
> Please ensure your blog configuration file (`hugo.toml`, `hugo.yaml`, or `hugo.json`) is updated to the latest version provided with the template.
|
||||
>
|
||||
> **Hugo frequently changes its configuration file structure**, which may lead to compatibility issues if your configuration is outdated.
|
||||
>
|
||||
> Check the [Anubis2 template](https://github.com/Junyi-99/hugo-theme-anubis2/tree/main/exampleSiteMultilingual) for the latest config file.
|
||||
|
||||
|
||||
|
||||
## Highlighted Features
|
||||
|
||||
- Multilingual
|
||||
@ -18,21 +30,25 @@ Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo
|
||||
- Mobile Support
|
||||
- [Full Features](wiki/Full-Features)
|
||||
|
||||
## Installation
|
||||
## Installation & Configuration
|
||||
|
||||
You need to install an extended version of Hugo to run this theme.
|
||||
|
||||
### As Git Submodule
|
||||
For more information read the [official setup guide of Hugo](https://gohugo.io/installation/).
|
||||
|
||||
Inside the folder of your Hugo site run:
|
||||
### Install theme as Git Submodule
|
||||
|
||||
$ git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2
|
||||
Inside the folder of your Hugo site, run:
|
||||
|
||||
For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo.
|
||||
```bash
|
||||
git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2
|
||||
```
|
||||
|
||||
That's all, let's configure anubis2.
|
||||
|
||||
### Configure your site
|
||||
|
||||
Don't be panic, configure Anubis2 is relatively simple.
|
||||
Don't be panic, configure Anubis2 is really **simple**.
|
||||
|
||||
**This is the minimum configuration:**
|
||||
|
||||
@ -42,29 +58,43 @@ languageCode = "en-us"
|
||||
theme = "anubis2"
|
||||
title = "Anubis2 Demo Site"
|
||||
|
||||
[author]
|
||||
[params.author]
|
||||
name = "Junyi"
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true # true | false; Enable unsafe mode to have a better experience
|
||||
|
||||
[markup.highlight]
|
||||
style = 'base16-snazzy' # Highlight.js style
|
||||
style = 'base16-snazzy' # Chroma style, find more at here: https://swapoff.org/chroma/playground/
|
||||
|
||||
```
|
||||
|
||||
It's not too late to keep the other fields as defaults and fine-tune them when you have time! (see [Configuration Example](https://github.com/Junyi-99/hugo-theme-anubis2/wiki/Configuration-Example))
|
||||
You are encouraged keeping other fields as defaults and fine-tune them when you have time! (see [Full Configuration Examples](https://github.com/Junyi-99/hugo-theme-anubis2/wiki/Configuration-Example))
|
||||
|
||||
### Run your site
|
||||
In the other way, you can check out the example site's [configuration file](exampleSiteMultilingual/hugo.toml)
|
||||
|
||||
In order to see your site in action, run Hugo's built-in local server.
|
||||
## Run your site
|
||||
|
||||
`$ hugo server`
|
||||
In order to see your site, run Hugo's built-in local server.
|
||||
|
||||
Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your browser.
|
||||
```bash
|
||||
hugo server
|
||||
```
|
||||
|
||||
Now enter [`http://localhost:1313`](http://localhost:1313/) in the address bar of your browser to open your site.
|
||||
|
||||
## Update Anubis2 to the latest version
|
||||
|
||||
In your Hugo site folder, run this command:
|
||||
|
||||
```bash
|
||||
git submodule update --remote
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/Junyi-99/hugo-theme-anubis2/issues) or make a PR.
|
||||
|
||||
## License
|
||||
|
||||
MIT © Junyi, 2024
|
||||
|
@ -154,14 +154,20 @@ thead {
|
||||
|
||||
table {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
overflow: scroll;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 0.5em 1em;
|
||||
padding: 0.25em 0.5em;
|
||||
border: 1px double var(--table-border-color);
|
||||
|
||||
}
|
||||
|
||||
/* Code */
|
||||
@ -175,15 +181,18 @@ kbd {
|
||||
color: var(--pre-color);
|
||||
background-color: var(--pre-bg-color);
|
||||
font-family: 'Menlo', 'Courier New', 'Consolas', monospace;
|
||||
font-size: 14.4px; /* 18px * 0.6 */
|
||||
font-size: 14.4px;
|
||||
/* 18px * 0.6 */
|
||||
line-height: 154%;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--pre-border-color);
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
/* <code> tag */
|
||||
code {
|
||||
font-size: 14.4px; /* 18px * 0.6 */
|
||||
font-size: 14.4px;
|
||||
/* 18px * 0.6 */
|
||||
padding: 0.1em 0.3em;
|
||||
}
|
||||
|
||||
@ -202,7 +211,8 @@ p kbd,
|
||||
pre kbd,
|
||||
p kbd kbd,
|
||||
pre kbd kbd {
|
||||
font-size: 14.4px; /* 18px * 0.6 */
|
||||
font-size: 14.4px;
|
||||
/* 18px * 0.6 */
|
||||
background-color: var(--kbd-bg-color);
|
||||
border: 1px solid var(--pre-border-color);
|
||||
border-width: 1px 2px 2px 1px;
|
||||
@ -248,11 +258,16 @@ div.highlight {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
div.highlight div {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
div.highlight pre {
|
||||
border: none;
|
||||
display: grid;
|
||||
margin: 0px;
|
||||
overflow: auto; /* Have to add this line, otherwise the "pre" and "code" will have different width */
|
||||
overflow: auto;
|
||||
/* Have to add this line, otherwise the "pre" and "code" will have different width */
|
||||
/* padding-left: 10px; */
|
||||
/* padding-right: 10px; */
|
||||
/* padding-top: 10px; */
|
||||
@ -262,6 +277,7 @@ div.highlight pre {
|
||||
div.highlight code {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
div.highlight code a:hover,
|
||||
|
@ -16,6 +16,7 @@ social_icons:
|
||||
vk: https://vk.com/%s
|
||||
youtube: https://www.youtube.com/c/%s
|
||||
4chan:
|
||||
bluesky: https://bsky.app/profile/%s
|
||||
# docs:
|
||||
gitlab:
|
||||
leetcode: https://leetcode.com/%s
|
||||
|
@ -1,7 +1,7 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Demo - Support for code, pre, kbd, mark"
|
||||
date = "2024-04-22"
|
||||
date = "2024-04-30"
|
||||
description = "Guide to advanced usage of Anubis2"
|
||||
tags = [
|
||||
"emoji",
|
||||
|
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chart-histogram"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 3v18h18" /><path d="M20 18v3" /><path d="M16 16v5" /><path d="M12 13v8" /><path d="M8 16v5" /><path d="M3 11c6 0 5 -5 9 -5s3 5 9 5" /></svg>
|
After Width: | Height: | Size: 468 B |
@ -1,7 +1,7 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Demo - Support for Diagrams"
|
||||
date = "2024-04-19"
|
||||
date = "2024-05-06"
|
||||
description = "Guide to advanced usage of Anubis2"
|
||||
tags = [
|
||||
"emoji",
|
110
exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md
Normal file
110
exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md
Normal file
@ -0,0 +1,110 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Demo - Support for Diagrams"
|
||||
date = "2024-05-06"
|
||||
description = "Guide to advanced usage of Anubis2"
|
||||
tags = [
|
||||
"emoji",
|
||||
]
|
||||
+++
|
||||
|
||||
Feel free to switch between the light and dark themes to see how the diagram adapts its colors accordingly.
|
||||
|
||||
## Mermaid Diagrams
|
||||
|
||||
```mermaid
|
||||
gantt
|
||||
title A Gantt Diagram
|
||||
dateFormat YYYY-MM-DD
|
||||
section Section
|
||||
A task :a1, 2014-01-01, 30d
|
||||
Another task :after a1, 20d
|
||||
section Another
|
||||
Task in Another :2014-01-12, 12d
|
||||
another task :24d
|
||||
|
||||
```
|
||||
|
||||
Get more examples at [About Mermaid](https://mermaid.js.org/intro/)
|
||||
|
||||
<!--more-->
|
||||
|
||||
```mermaid
|
||||
gitGraph:
|
||||
commit "Ashish"
|
||||
branch newbranch
|
||||
checkout newbranch
|
||||
commit id:"1111"
|
||||
commit tag:"test"
|
||||
checkout main
|
||||
commit type: HIGHLIGHT
|
||||
commit
|
||||
merge newbranch
|
||||
commit
|
||||
branch b2
|
||||
commit
|
||||
```
|
||||
|
||||
|
||||
|
||||
```mermaid
|
||||
stateDiagram
|
||||
[*] --> Still
|
||||
Still --> [*]
|
||||
|
||||
Still --> Moving
|
||||
Moving --> Still
|
||||
Moving --> Crash
|
||||
Crash --> [*]
|
||||
|
||||
```
|
||||
|
||||
```mermaid
|
||||
sankey-beta
|
||||
|
||||
Pumped heat,"Heating and cooling, ""homes""",193.026
|
||||
Pumped heat,"Heating and cooling, ""commercial""",70.672
|
||||
```
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
loop Daily query
|
||||
Alice->>Bob: Hello Bob, how are you?
|
||||
alt is sick
|
||||
Bob->>Alice: Not so good :(
|
||||
else is well
|
||||
Bob->>Alice: Feeling fresh like a daisy
|
||||
end
|
||||
|
||||
opt Extra response
|
||||
Bob->>Alice: Thanks for asking
|
||||
end
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Alice
|
||||
participant Bob
|
||||
Alice->>John: Hello John, how are you?
|
||||
loop Healthcheck
|
||||
John->>John: Fight against hypochondria
|
||||
end
|
||||
Note right of John: Rational thoughts <br/>prevail!
|
||||
John-->>Alice: Great!
|
||||
John->>Bob: How about you?
|
||||
Bob-->>John: Jolly good!
|
||||
```
|
||||
|
||||
## GoAT
|
||||
|
||||
```goat
|
||||
. . . .--- 1 .-- 1 / 1
|
||||
/ \ | | .---+ .-+ +
|
||||
/ \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2
|
||||
+ + | | | | ---+ ---+ +
|
||||
/ \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3
|
||||
/ \ / \ | | | | | | | | '---+ '-+ +
|
||||
1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4
|
||||
```
|
@ -10,7 +10,31 @@ tags = [
|
||||
]
|
||||
+++
|
||||
|
||||
There are 9 tests.
|
||||
```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199}
|
||||
int main() {
|
||||
int a = 1;
|
||||
if (a == 999)
|
||||
// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`.
|
||||
// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content.
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Truth Table
|
||||
|
||||
| Item | Line Numbers | Highlight Lines | Anchor Lines | Wide CodeBlock Scroll | Supported |
|
||||
| ------------------------ | ------------ | --------------- | ------------ | --------------------- | --------- |
|
||||
| **Full Feature Support** | ture | true | true | ✅ | ✅ |
|
||||
| | table | true | true | ✅ | ✅ |
|
||||
| | table | true | false | ✅ | ✅ |
|
||||
| | inline | | | ✅ | ✅ |
|
||||
| | ture | true | false | ✅ | ✅ |
|
||||
| | ture | false | false | ✅ | ✅ |
|
||||
| | false | true | / | ✅ | ✅ |
|
||||
| Basic Support | false | false | / | ✅ | ✅ |
|
||||
|
||||
Note: Anubis2 does not support `hl_inline=true`
|
||||
|
||||
<!--more-->
|
||||
|
||||
@ -45,7 +69,7 @@ int main() {
|
||||
int main() {
|
||||
int a = 1;
|
||||
if (a == 999)
|
||||
// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`.
|
||||
// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`.
|
||||
// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content.
|
||||
}
|
||||
return 0;
|
||||
@ -102,30 +126,34 @@ Now you can click on the line number to get a link to that line.
|
||||
int main() {
|
||||
int a = 1;
|
||||
if (a == 999)
|
||||
// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`.
|
||||
// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`.
|
||||
// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content.
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Line Number (table) and Highlight Inline (❌ Not supported by Anubis2)
|
||||
### Highlight Inline are not supported by Anubis2 ❌
|
||||
|
||||
```c {linenos=true,hl_lines=[1,"3-4",8], hl_inline=true}
|
||||
```c {linenos=true,hl_lines=[1,3,5], hl_inline=true}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```c {linenos=true,hl_lines=[1,"3-4",8], hl_inline=true}
|
||||
```c {linenos=true,hl_lines=[1,3,5], hl_inline=true}
|
||||
int main() {
|
||||
int a = 1;
|
||||
if (a == 999)
|
||||
// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`.
|
||||
// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content.
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
Those are trash codes.
|
||||
|
||||
### Highlight shortcode, with Line Number (table), with Highlight Lines and Anchor
|
||||
|
||||
{{</* highlight c "linenos=table,hl_lines=1 3-4 8, anchorlinenos=true" */>}}
|
||||
@ -175,4 +203,4 @@ if (a == 999)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
{{< / highlight >}}
|
||||
{{< / highlight >}} -->
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 1 (😃 Easy)"
|
||||
date: 2024-04-25T1:54:12+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 2 (😏 Easy)"
|
||||
date: 2024-04-25T1:54:13+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 3 (🤔 Easy)"
|
||||
date: 2024-04-25T1:54:14+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 4 (😅 Easy?)"
|
||||
date: 2024-04-25T1:54:15+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 5 (😥 Medium)"
|
||||
date: 2024-04-25T1:54:16+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 6 (🤯 Hard)"
|
||||
date: 2024-04-25T1:54:17+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 7 (😱 Bad Dream)"
|
||||
date: 2024-04-25T1:54:18+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: "Demo - Summary Rendering Test 8 (💀 Nightmare)"
|
||||
date: 2024-04-25T1:54:19+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
<!--<!--more-->
|
||||
|
@ -9,7 +9,7 @@ tags = [
|
||||
+++
|
||||
|
||||
Emoji can be enabled in a Hugo project in a number of ways.
|
||||
<!--more-->
|
||||
|
||||
The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes).
|
||||
|
||||
To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.
|
||||
|
@ -10,8 +10,6 @@ tags = [
|
||||
|
||||
在 Hugo 博客里,你可以用多种方式使用 Emoji:
|
||||
|
||||
<!--more-->
|
||||
|
||||
The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes).
|
||||
|
||||
To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.
|
||||
|
@ -1,7 +1,7 @@
|
||||
+++
|
||||
author = "Junyi"
|
||||
title = "Demo - Social Icons"
|
||||
date = "2024-04-23"
|
||||
date = "2024-05-05"
|
||||
description = "Guide to using social icons supported by Anubis2."
|
||||
tags = [
|
||||
"icons",
|
||||
|
@ -1,7 +1,7 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Markdown Syntax Guide"
|
||||
date = "2019-03-11"
|
||||
date = "2024-05-07"
|
||||
description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
tags = [
|
||||
"markdown",
|
||||
@ -19,24 +19,24 @@ favorite = true
|
||||
+++
|
||||
|
||||
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
|
||||
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Headings
|
||||
|
||||
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
|
||||
The following HTML `<h2>`—`<h6>` elements represent 5 levels of section headings. `<h2>` is the highest section level while `<h6>` is the lowest.
|
||||
|
||||
# H1
|
||||
## H2
|
||||
|
||||
You should not use `# H1` in your markdown file, since the title is `#H1`.
|
||||
You should using `## H2` as your section title, since the file title is `# H1`
|
||||
|
||||
If you use, you will get a warning from linter:
|
||||
If you use `# H1` as your section title, you will get a warning from linter:
|
||||
|
||||
```txt
|
||||
MD025/single-title/single-h1: Multiple top-level headings in the same document
|
||||
```
|
||||
|
||||
## H2
|
||||
|
||||
### H3
|
||||
|
||||
#### H4
|
||||
@ -45,9 +45,11 @@ MD025/single-title/single-h1: Multiple top-level headings in the same document
|
||||
|
||||
###### H6
|
||||
|
||||
|
||||
## Paragraph
|
||||
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur?
|
||||
Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga.
|
||||
|
||||
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
|
||||
|
||||
@ -61,7 +63,7 @@ The blockquote element represents content that is quoted from another source, op
|
||||
>
|
||||
> **Note** that you can use *Markdown syntax* within a blockquote.
|
||||
|
||||
#### Blockquote with attribution
|
||||
### Blockquote with attribution
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.</p>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
@ -85,9 +87,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
|
||||
|
||||
## Code Blocks
|
||||
|
||||
### Code block with backticks
|
||||
### Code block with backticks and showing highlighted lines
|
||||
|
||||
```html
|
||||
```html {linenos=table, hl_lines=[1,"4-5",8], linenostart=199}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -158,6 +160,6 @@ H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
|
||||
Press <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
|
@ -2,38 +2,15 @@
|
||||
author: Hugo Authors
|
||||
title: Math Typesetting
|
||||
date: 2019-03-08
|
||||
description: A brief guide to setup KaTeX
|
||||
description: A brief guide to setup MathJax
|
||||
math: true
|
||||
---
|
||||
|
||||
Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
|
||||
<!--more-->
|
||||
|
||||
In this example we will be using [KaTeX](https://katex.org/)
|
||||
- To enable MathJax on a page basis include the parameter `math: true` in content files.
|
||||
|
||||
- Create a partial under `/layouts/partials/math.html`
|
||||
- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally.
|
||||
- Include the partial in your templates like so:
|
||||
|
||||
```
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ 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.
|
||||
|
||||
**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.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
|
||||
{{ end }}
|
||||
{{</ math.inline >}}
|
||||
|
||||
### Examples
|
||||
## Examples
|
||||
|
||||
Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$
|
||||
|
||||
|
@ -31,7 +31,7 @@ tractus malis.
|
||||
4. Arcanaque montibus omnes
|
||||
5. Quidem et
|
||||
|
||||
# Vagus elidunt
|
||||
## Vagus elidunt
|
||||
|
||||
<svg class="canon" xmlns="http://www.w3.org/2000/svg" overflow="visible" viewBox="0 0 496 373" height="373" width="496"><g fill="none"><path stroke="#000" stroke-width=".75" d="M.599 372.348L495.263 1.206M.312.633l494.95 370.853M.312 372.633L247.643.92M248.502.92l246.76 370.566M330.828 123.869V1.134M330.396 1.134L165.104 124.515"></path><path stroke="#ED1C24" stroke-width=".75" d="M275.73 41.616h166.224v249.05H275.73zM54.478 41.616h166.225v249.052H54.478z"></path><path stroke="#000" stroke-width=".75" d="M.479.375h495v372h-495zM247.979.875v372"></path><ellipse cx="498.729" cy="177.625" rx=".75" ry="1.25"></ellipse><ellipse cx="247.229" cy="377.375" rx=".75" ry="1.25"></ellipse></g></svg>
|
||||
|
||||
|
@ -3,11 +3,13 @@ languageCode = "en-us"
|
||||
defaultContentLanguage = "en"
|
||||
title = "Anubis2 Demo Site"
|
||||
theme = "anubis2"
|
||||
paginate = 5
|
||||
|
||||
disqusShortname = ""
|
||||
|
||||
[author]
|
||||
[pagination]
|
||||
pagerSize = 5
|
||||
|
||||
|
||||
[params.author]
|
||||
name = "Junyi"
|
||||
email = "me@junyi.dev"
|
||||
location = "Singapore"
|
||||
@ -17,6 +19,9 @@ description = "Anubis2 is another simple minimalist theme for Hugo blog engine."
|
||||
dateFormat = "2006-01-02"
|
||||
paginationSinglePost = true
|
||||
|
||||
# icp = "京ICP备xxxxx号-1" # for China ICP license
|
||||
# police = "京公网安备 12345678号" # for China police beian
|
||||
|
||||
colorTheme = "auto"
|
||||
colorThemeSwitcher = true
|
||||
|
||||
@ -50,7 +55,8 @@ social = [
|
||||
{ id = "netease-music", url = "#" },
|
||||
{ id = "telegram", url = "#" },
|
||||
{ id = "x", url = "#" },
|
||||
{ id = "youtube", url = "#" }
|
||||
{ id = "youtube", url = "#" },
|
||||
{ id = "bluesky", url = "#" }
|
||||
]
|
||||
|
||||
[[menu.main]]
|
||||
@ -150,53 +156,23 @@ author = "authors"
|
||||
defaultMarkdownHandler = 'goldmark'
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
unsafe = true # Enable unsafe mode to have a better experience
|
||||
|
||||
[markup.highlight]
|
||||
anchorLineNos = false
|
||||
codeFences = true # tested with true and false. Both work.
|
||||
noClasses = true # If you run with markup.highlight.noClasses=false in your site configuration, you need a style sheet.
|
||||
style = 'base16-snazzy'
|
||||
style = 'catppuccin-frappe' # Find more style at here: https://swapoff.org/chroma/playground/
|
||||
tabWidth = 4
|
||||
|
||||
[params.UmamiAnalytics]
|
||||
enabled = true
|
||||
dnt = false
|
||||
id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID
|
||||
id = "d01ce82c-c8f4-4714-ba37-ba4899f2a885" # Website ID
|
||||
datacache = false
|
||||
url = "https://eu.umami.is/script.js"
|
||||
shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app"
|
||||
url = "https://umami.xtra.science/script.js"
|
||||
shareUrl = "https://umami.xtra.science/share/Fy0goUn0b9rrxxGe/hugo-theme-anubis2.netlify.app"
|
||||
|
||||
|
||||
# Experimental features
|
||||
[params.analytics]
|
||||
[params.analytics.umami]
|
||||
enabled = true
|
||||
dnt = false
|
||||
id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID
|
||||
datacache = false
|
||||
url = "https://eu.umami.is/script.js"
|
||||
shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app"
|
||||
|
||||
[params.analytics.google]
|
||||
enabled = false
|
||||
|
||||
[params.comments]
|
||||
[params.comments.giscus]
|
||||
enabled = true
|
||||
repo = "Junyi-99/hugo-theme-anubis2"
|
||||
repoId = "R_kgDOLEp76Q"
|
||||
category = "General"
|
||||
categoryId = "DIC_kwDOLEp76c4CcbPS"
|
||||
lazyload = false
|
||||
datamapping = "pathname"
|
||||
[params.comments.disqus]
|
||||
enabled = false
|
||||
shortname = ""
|
||||
[params.comments.utterances]
|
||||
enabled = false
|
||||
repo = "Junyi-99/hugo-theme-anubis2"
|
||||
[params.comments.isso]
|
||||
enabled = false
|
||||
[params.comments.graphcommentId]
|
||||
enabled = false
|
||||
[params.GoogleAnalytics]
|
||||
enabled = true
|
||||
gtag = "G-32F16X8HLF"
|
56
i18n/ce.yaml
Normal file
56
i18n/ce.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
powered:
|
||||
other: "Озорг"
|
||||
|
||||
theme:
|
||||
other: "тем"
|
||||
|
||||
readMore:
|
||||
other: "ДӀаеша"
|
||||
|
||||
toNewPosts:
|
||||
other: "керла дӀаяздаршка хӀо"
|
||||
|
||||
toOldPosts:
|
||||
other: "тиша дӀаяздаршка хӀо"
|
||||
|
||||
tag:
|
||||
other: "тег"
|
||||
|
||||
Tags:
|
||||
other: "Тегаш"
|
||||
|
||||
Posts:
|
||||
other: "ДӀаяздарш"
|
||||
|
||||
category:
|
||||
other: "категори"
|
||||
|
||||
Categories:
|
||||
other: "Категореш"
|
||||
|
||||
toAllTags:
|
||||
other: "тегаш лемаре хӀо"
|
||||
|
||||
toAllAuthors:
|
||||
other: "авторш лемаре хӀо"
|
||||
|
||||
toAllCategories:
|
||||
other: "категореш лемаре хӀо"
|
||||
|
||||
skipToContent:
|
||||
other: "коьрта контенте хӀо"
|
||||
|
||||
readNext:
|
||||
other: "ДӀаеша"
|
||||
|
||||
lastMod:
|
||||
other: "йуха яздин ю:"
|
||||
|
||||
toNewPost:
|
||||
other: "керла д1аяздаре хӀо"
|
||||
|
||||
toOldPost:
|
||||
other: "тиша дӀаяздаре хӀо"
|
||||
|
||||
videoIsNotSupported:
|
||||
other: "хӀа браузер окх видео цан болх ца бо"
|
@ -12,9 +12,27 @@
|
||||
<link>{{ .RelPermalink }}</link>
|
||||
<description>{{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }}</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 }}
|
||||
{{ with .email }}
|
||||
<managingEditor>{{.}}
|
||||
{{ with $.Site.Params.author.name }}
|
||||
({{.}})
|
||||
{{end}}
|
||||
</managingEditor>
|
||||
{{end}}
|
||||
|
||||
{{ with .Site.Params.author.email }}
|
||||
<webMaster>
|
||||
{{.}}
|
||||
{{ with $.Site.Params.author.name }}
|
||||
({{.}})
|
||||
{{end}}
|
||||
</webMaster>
|
||||
{{end}}
|
||||
{{ 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" }}
|
||||
@ -25,7 +43,7 @@
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .RelPermalink }}</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>{{ .RelPermalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
</item>
|
||||
|
@ -23,8 +23,8 @@
|
||||
</article>
|
||||
|
||||
{{ $readNextPosts := 3}}
|
||||
{{ if isset .Site.Params "readNextPosts" }}
|
||||
{{ $readNextPosts := .Site.Params.readNextPosts }}
|
||||
{{ if site.Params.readNextPosts }}
|
||||
{{ $readNextPosts = site.Params.readNextPosts }}
|
||||
{{ end }}
|
||||
|
||||
{{ if gt $readNextPosts 0 }}
|
||||
@ -53,29 +53,10 @@
|
||||
*/}}
|
||||
|
||||
{{ if .Store.Get "hasMermaid" }}
|
||||
{{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }}
|
||||
{{ partial "mermaid_support.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ $colorTheme := "light" }}
|
||||
{{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }}
|
||||
{{ $colorTheme = site.Params.colortheme | lower }}
|
||||
{{ end }}
|
||||
|
||||
<script type="module">
|
||||
function detectCurrentScheme3() {
|
||||
const defaultTheme = "{{ $colorTheme }}";
|
||||
if (localStorage !== null && localStorage.getItem("user-color-scheme")) {
|
||||
return localStorage.getItem("user-color-scheme");
|
||||
}
|
||||
if (defaultTheme === "dark" || defaultTheme === "light") {
|
||||
return defaultTheme;
|
||||
}
|
||||
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
}
|
||||
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||
window.mermaid = mermaid;
|
||||
window.initMermaid()
|
||||
document.body.dispatchEvent(new CustomEvent(detectCurrentScheme3() + "-theme-set"));
|
||||
</script>
|
||||
{{ if .Params.math }}
|
||||
{{ partial "mathjax_support.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -2,23 +2,23 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{ range where .Data.Pages "Params.hidden" "!=" true }}
|
||||
{{- if .RelPermalink -}}
|
||||
<url>
|
||||
<loc>{{ .RelPermalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
href="{{ .RelPermalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
href="{{ .RelPermalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{- if .Permalink -}}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
</urlset>
|
||||
|
@ -8,6 +8,7 @@
|
||||
{{ range (.Paginate $pages).Pages }}
|
||||
{{ partial "post-summary.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{ if .Site.DisqusShortname }}
|
||||
{{ if .Site.Config.Services.Disqus.Shortname }}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
|
@ -5,19 +5,35 @@
|
||||
{{ end }}
|
||||
|
||||
<div class="common-footer-bottom">
|
||||
{{ if .Site.Menus.footer }}
|
||||
{{ if site.Menus.footer }}
|
||||
{{ $currentPage := . }}
|
||||
<ul class="footer-menu">
|
||||
{{ range .Site.Menus.footer }}
|
||||
{{ range site.Menus.footer }}
|
||||
<li><a class="{{if or ($currentPage.IsMenuCurrent "footer" .) ($currentPage.HasMenuCurrent "footer" .) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
<div style="display: flex; align-items: center; gap:8px">
|
||||
© {{ if isset .Site.Author "name"}}{{ .Site.Author.name }}, {{end}}{{ now.Year }}
|
||||
{{ if .Site.Params.UmamiAnalytics.shareUrl }}
|
||||
<a aria-label="Check statistics data" style="display: flex; align-items: center; border-bottom: none; cursor: pointer; color: var(--pagination-link-color)" href="{{ .Site.Params.UmamiAnalytics.shareUrl }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-report-analytics"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M9 17v-5" /><path d="M12 17v-1" /><path d="M15 17v-3" /></svg></a>
|
||||
© {{ if site.Params.Author.name }} {{ site.Params.Author.name }}, {{end}} {{ now.Year }}
|
||||
{{ if site.Params.UmamiAnalytics.shareUrl }}
|
||||
<a aria-label="Check statistics data" style="display: flex; align-items: center; border-bottom: none; cursor: pointer; color: var(--pagination-link-color)" href="{{ site.Params.UmamiAnalytics.shareUrl }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-report-analytics"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M9 17v-5" /><path d="M12 17v-1" /><path d="M15 17v-3" /></svg></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div style="display:flex;align-items: center">
|
||||
{{ $police := site.Params.police }}
|
||||
{{ $info := "info" }}
|
||||
{{ $pattern := "[0-9]+" }}
|
||||
{{ $matches := findRE $pattern $police }}
|
||||
{{ if $matches }}
|
||||
{{ $firstNumber := index $matches 0 }}
|
||||
{{ $info = print $firstNumber }}
|
||||
<img src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png" alt="备案图标" style="width: 1em;height: 1em;object-fit: contain;">
|
||||
<a target="_blank" href="https://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{$info}}">{{ site.Params.police }}</a>
|
||||
|
||||
{{ end }}
|
||||
{{ if site.Params.icp }}
|
||||
<a target="_blank" href="https://beian.miit.gov.cn/">{{ site.Params.icp }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div>
|
||||
|
8
layouts/partials/google_analytics.html
Normal file
8
layouts/partials/google_analytics.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.GoogleAnalytics.gtag }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ .Site.Params.GoogleAnalytics.gtag }}');
|
||||
</script>
|
@ -59,8 +59,17 @@
|
||||
|
||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
|
||||
{{ range site.Params.customCSS }}
|
||||
{{ with resources.Get . | toCSS $opts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ $r := "" }}
|
||||
{{ with resources.Get . }}
|
||||
{{ $r = . }}
|
||||
{{ else }}
|
||||
{{ errorf "error: You defined customCSS, but %s was not found in the local file system, please check your config." . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $r}}
|
||||
{{ with $r | toCSS $opts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@ -103,8 +112,8 @@
|
||||
<meta property="article:tag" content="">
|
||||
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
|
||||
|
||||
{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ if (.Site.Params.GoogleAnalytics.enabled) }}
|
||||
{{ partial "google_analytics.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (.Site.Params.UmamiAnalytics.enabled ) }}
|
||||
|
24
layouts/partials/mermaid_support.html
Normal file
24
layouts/partials/mermaid_support.html
Normal file
@ -0,0 +1,24 @@
|
||||
{{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }}
|
||||
|
||||
{{ $colorTheme := "light" }}
|
||||
{{ if and (site.Params.colortheme) (ne site.Params.colortheme "") }}
|
||||
{{ $colorTheme = site.Params.colortheme | lower }}
|
||||
{{ end }}
|
||||
|
||||
<script type="module">
|
||||
function detectCurrentScheme3() {
|
||||
const defaultTheme = "{{ $colorTheme }}";
|
||||
if (localStorage !== null && localStorage.getItem("user-color-scheme")) {
|
||||
return localStorage.getItem("user-color-scheme");
|
||||
}
|
||||
if (defaultTheme === "dark" || defaultTheme === "light") {
|
||||
return defaultTheme;
|
||||
}
|
||||
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
}
|
||||
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||
window.mermaid = mermaid;
|
||||
window.initMermaid()
|
||||
document.body.dispatchEvent(new CustomEvent(detectCurrentScheme3() + "-theme-set"));
|
||||
</script>
|
@ -1,7 +1,24 @@
|
||||
<article class="post-list h-feed post-card">
|
||||
<div class="post-header">
|
||||
<header>
|
||||
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " | markdownify }}</a></h1>
|
||||
{{ $random := (md5 .Title) }}
|
||||
{{ $iconPath := printf "%sicon.svg" .File.Dir }}
|
||||
{{ if fileExists $iconPath }}
|
||||
<style>
|
||||
.post-icon-{{ $random }}::before {
|
||||
display: inline-block;
|
||||
content: '';
|
||||
background: url("/{{ $iconPath }}");
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
background-size: auto 100%;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
</style>
|
||||
{{ end }}
|
||||
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}} {{ if fileExists $iconPath}}post-icon-{{$random}}{{end}}">
|
||||
<a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " | markdownify }}</a>
|
||||
</h1>
|
||||
</header>
|
||||
{{ partial "post-language-switcher.html" . }}
|
||||
</div>
|
||||
@ -11,11 +28,20 @@
|
||||
{{ .Summary | safeHTML }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Truncated) (.Site.Params.readMore) }}
|
||||
<div class="read-more">
|
||||
<a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Store.Get "hasMermaid" }}
|
||||
{{ partial "mermaid_support.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.math }}
|
||||
{{ partial "mathjax_support.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "post-info.html" . }}
|
||||
</article>
|
||||
|
1
layouts/partials/tabler-icons/bluesky.svg
Normal file
1
layouts/partials/tabler-icons/bluesky.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-bluesky"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.335 5.144c-1.654 -1.199 -4.335 -2.127 -4.335 .826c0 .59 .35 4.953 .556 5.661c.713 2.463 3.13 2.75 5.444 2.369c-4.045 .665 -4.889 3.208 -2.667 5.41c1.03 1.018 1.913 1.59 2.667 1.59c2 0 3.134 -2.769 3.5 -3.5c.333 -.667 .5 -1.167 .5 -1.5c0 .333 .167 .833 .5 1.5c.366 .731 1.5 3.5 3.5 3.5c.754 0 1.637 -.571 2.667 -1.59c2.222 -2.203 1.378 -4.746 -2.667 -5.41c2.314 .38 4.73 .094 5.444 -2.369c.206 -.708 .556 -5.072 .556 -5.661c0 -2.953 -2.68 -2.025 -4.335 -.826c-2.293 1.662 -4.76 5.048 -5.665 6.856c-.905 -1.808 -3.372 -5.194 -5.665 -6.856z" /></svg>
|
After Width: | Height: | Size: 873 B |
@ -1,8 +1,11 @@
|
||||
{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }}
|
||||
{{ $toc := true }}
|
||||
{{ if isset .Params "toc" }}
|
||||
{{ $toc = .Params.toc }}
|
||||
{{ else }}
|
||||
{{ $toc = true }}
|
||||
{{ $toc = ge .WordCount .Site.Params.tocWordCount }}
|
||||
{{ if and (isset .Site.Params "toc") (not (.Site.Params.toc)) }}
|
||||
{{ $toc = false }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ publish = "exampleSiteMultilingual/public"
|
||||
command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --baseURL $URL"
|
||||
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.115.4"
|
||||
HUGO_VERSION = "0.136.5"
|
||||
HUGO_THEME = "repo"
|
||||
|
||||
[context.deploy-preview]
|
||||
|
Loading…
Reference in New Issue
Block a user