Compare commits

...

57 Commits
v1.3.3 ... main

Author SHA1 Message Date
Junyi
0500942ded
Merge pull request #83 from Junyi-99/Junyi-99-patch-1 2024-11-22 04:39:50 +00:00
Junyi
48c4e20a7d
Update README.md 2024-11-22 12:39:39 +08:00
Junyi
1fa083e0a4
Merge pull request #82 from Junyi-99/Junyi-99-patch-1 2024-11-22 04:39:08 +00:00
Junyi
c08222376c
Update README.md 2024-11-22 12:38:25 +08:00
Junyi
2b390c73d5
Merge pull request #80 from Junyi-99/feat-better-preview 2024-11-18 14:33:05 +08:00
Junyi Hou
c9043c7fcb fix: netlify script 2024-11-18 14:32:07 +08:00
Junyi Hou
40ec45006c feature: enhanced table 2024-11-17 20:20:34 +08:00
Junyi Hou
c434a66c44 fix: table too wide on small devices 2024-11-17 20:10:41 +08:00
Junyi Hou
31d741c932 update the readme 2024-11-17 19:45:22 +08:00
Junyi Hou
d18fb480d3 fix: the readme and make the code block scrollable 2024-11-17 19:44:18 +08:00
Junyi Hou
6b98e015c6 update .gitignore 2024-11-17 19:23:44 +08:00
Junyi Hou
c92d59921f fix: customCSS error message 2024-11-17 19:22:31 +08:00
Junyi Hou
2a6d9b31f8 feat: better preview for math and mermaid 2024-11-17 19:19:14 +08:00
Junyi
8dc8e9ff97
Merge pull request #79 from Junyi-99/feat-77 2024-11-17 16:54:40 +08:00
Junyi Hou
fcd91ec6ff add: bluesky social icon #77 2024-11-17 16:54:09 +08:00
Junyi
95844a6f7a
Merge pull request #63 from Junyi-99/Junyi-99-patch-1
Update README.md
2024-09-11 12:21:34 +08:00
Junyi
d652a8e31c
Update README.md 2024-09-11 12:21:21 +08:00
Junyi
d9b7678e64
Merge pull request #62 from Junyi-99/develop
Develop
2024-09-11 12:09:18 +08:00
Junyi Hou
ac2950a4c0
fix: icon now shown in other languages. 2024-09-11 12:06:53 +08:00
Junyi Hou
422f416612
align with latest Hugo. Hugo is a piece of shit! 2024-09-11 11:57:49 +08:00
Junyi Hou
f53cc0573b upgrade config 2024-08-15 15:54:53 +08:00
Junyi Hou
9b689084a3 upgrade DisqusShortname 2024-08-15 13:43:06 +08:00
Junyi Hou
6806902501 add feat: load "icon.svg" in the posts foler 2024-07-25 16:08:42 +08:00
Junyi
cc7b31bbd0
Merge pull request #59 from Junyi-99/feat-experimental-config
update tracking code
2024-06-14 15:50:21 +08:00
Junyi Hou
0ceec0db71 update GoogleAnalytics for ExampleSite 2024-06-14 15:48:44 +08:00
Junyi
a42dfbdbca
Merge pull request #58 from Junyi-99/feat-experimental-config
Update Readme
2024-06-14 15:41:36 +08:00
Junyi Hou
793e1778cb update readme 2024-06-14 15:40:38 +08:00
Junyi Hou
d3d7541077 update Readme 2024-06-14 15:33:49 +08:00
Junyi
fbd7b4c939
Merge pull request #57 from Junyi-99/feat-experimental-config
add: added error message when customCSS not exist
2024-06-14 15:31:36 +08:00
Junyi
0717eded21
Merge pull request #56 from joaosenger/fix-google-analytics
Fix: google analytics
2024-06-12 01:16:14 +08:00
Junyi
1d9a2eb91a
Merge pull request #53 from massifsurfer/patch-1
Create ce.yaml
2024-06-12 01:08:48 +08:00
Joao Senger
f5bb357b12 fix: gtagexample 2024-06-11 10:36:37 -03:00
Joao Senger
728414737c fix: googleAnalytics 2024-06-11 10:27:58 -03:00
Joao Senger
14d0777437 feat: googleAnalytics 2024-06-11 10:21:37 -03:00
Vlad Grigorian
8e659b1110
Create ce.yaml
i18n for Chechen language
2024-06-08 20:33:09 +03:00
Junyi Hou
2259c04f32 add: added error message when customCSS not exist 2024-05-13 11:03:14 +08:00
Junyi
fc83e3314e
Merge pull request #51 from Junyi-99/feat-experimental-config
fix bug
2024-05-07 16:03:37 +08:00
Junyi Hou
bd3ab84db8 update: change demo site posts order to attract more peoples. 2024-05-07 16:03:03 +08:00
Junyi Hou
8f622b49cf fix: fix the linenumber disappearing because of fix previous bug. 2024-05-07 15:56:37 +08:00
Junyi Hou
5583510cdd fix: fix #47 2024-05-07 15:49:30 +08:00
Junyi
80a6c24950
Merge pull request #50 from Hanse00/main
Corrects readNextPosts logic
2024-05-07 01:36:00 +08:00
Philip Mallegol-Hansen
8c718ed668
Corrects readNextPosts logic
The docs at https://gohugo.io/functions/collections/isset/ specify that the isset function must be called with a lowercase representation of the key we wish to check.

If we do not, the function always returns false.
2024-05-06 10:01:20 -07:00
Junyi
a860ae9764
Merge pull request #46 from Junyi-99/feat-experimental-config
fix: fix the sitemap url
2024-05-03 01:30:49 +08:00
Junyi Hou
c3a7039b35 fix the sitemap url 2024-05-03 01:30:14 +08:00
Junyi
d27aa62d9e
Merge pull request #44 from Hanse00/main 2024-05-02 13:04:38 +08:00
Philip Mallegol-Hansen
5b402c4b5d
Merge branch 'Junyi-99:main' into main 2024-05-01 14:14:28 -07:00
Philip Mallegol-Hansen
8c4d7defca
Improves ToC logic to account for both site and page configuration 2024-05-01 13:58:51 -07:00
Junyi
6f57af9f0a
Merge pull request #45 from Junyi-99/feat-experimental-config
Feat experimental config
2024-05-01 14:36:07 +08:00
Philip Mallegol-Hansen
7484d058f2
Corrects logic for enabling ToC 2024-04-30 22:46:39 -07:00
Junyi Hou
4f04a33623 del: remove experimental configs to reduce misleading.
these configs has not been implemented.
2024-04-29 15:50:00 +08:00
Junyi Hou
b782018b8c update: hide all summary rendering tests because Hugo refused to fix the bug. 2024-04-29 15:47:00 +08:00
Junyi
f9b293c17d
Merge pull request #43 from ChenYin626/main
added support for police beian for China ISP
2024-04-29 15:40:34 +08:00
chenyin
b44d2a736c added support for police beian for China ISP 2024-04-29 15:23:22 +08:00
Junyi
bd0cd40fbd
Merge pull request #42 from Junyi-99/Junyi-99-patch-2
Update README.md
2024-04-29 12:24:33 +08:00
Junyi
48f1064af1
Update README.md 2024-04-29 12:22:40 +08:00
Junyi
3310c840fd
Merge pull request #41 from Junyi-99/feat-experimental-config
add: added support for ICP beian for China ISP
2024-04-29 12:09:59 +08:00
Junyi Hou
06a4f7aceb add: added support for ICP beian for China ISP 2024-04-29 12:09:19 +08:00
38 changed files with 469 additions and 178 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
public/
public/
.DS_Store

View File

@ -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!
>
![image](https://github.com/Junyi-99/hugo-theme-anubis2/assets/14367694/8d9a591b-e168-4328-a770-eb2e8f04f657)
| 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

View File

@ -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,

View File

@ -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

View File

@ -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",

View 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-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

View File

@ -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",

View 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
```

View File

@ -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 >}} -->

View File

@ -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]
---

View File

@ -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]
---

View File

@ -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]
---

View File

@ -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]
---

View File

@ -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]
---

View File

@ -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]
---

View File

@ -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]
---

View File

@ -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-->

View File

@ -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 sites [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.

View File

@ -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 sites [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.

View File

@ -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",

View File

@ -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.

View File

@ -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… $$

View File

@ -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>

View File

@ -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
View 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: "хӀа браузер окх видео цан болх ца бо"

View File

@ -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>

View File

@ -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 }}

View File

@ -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>

View File

@ -8,6 +8,7 @@
{{ range (.Paginate $pages).Pages }}
{{ partial "post-summary.html" . }}
{{ end }}
{{ partial "pagination.html" . }}
</div>

View File

@ -1,4 +1,4 @@
{{ if .Site.DisqusShortname }}
{{ if .Site.Config.Services.Disqus.Shortname }}
{{ partial "disqus.html" . }}
{{ end }}

View File

@ -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>
&nbsp;
{{ end }}
{{ if site.Params.icp }}
<a target="_blank" href="https://beian.miit.gov.cn/">{{ site.Params.icp }}</a>
{{ end }}
</div>
<div>

View 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>

View File

@ -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 ) }}

View 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>

View File

@ -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>

View 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

View File

@ -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 }}

View File

@ -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]