Compare commits
85 Commits
v1.3.2-pre
...
main
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 | ||
|
8b402ff168 | ||
|
007dc9d929 | ||
|
01358cd31f | ||
|
fb52f33321 | ||
|
4d6fbc8c9a | ||
|
a60fc4661f | ||
|
893f4a77a4 | ||
|
e7a93e2088 | ||
|
87172dbdfc | ||
|
e57e3dd83d | ||
|
64ffd77659 | ||
|
d9cb67008f | ||
|
5fc27f5285 | ||
|
9507d51bd2 | ||
|
adce82a54c | ||
|
764e110d32 | ||
|
6965a86c4d | ||
|
18110d3f43 | ||
|
1f6787278d | ||
|
dca1ced53c | ||
|
68a33f8d40 | ||
|
a44399eb41 | ||
|
068a362879 | ||
|
4c59bcb723 | ||
|
3f5f3d7ced | ||
|
2c8a0e374e | ||
|
84276e542d | ||
|
90a5c66d8b |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
public/
|
||||
.DS_Store
|
32
Features.md
Normal file
32
Features.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Features
|
||||
|
||||
1. Automatic Dark/Light mode based on system settings
|
||||
2. Dark/Light mode switcher
|
||||
3. Automatic Diagram dark/light switch
|
||||
4. Automatic Giscus dark/light switch
|
||||
|
||||
| Feature (light/dark mode) | Anubis2 |
|
||||
| ---------------------------------------------------------------------- | ------- |
|
||||
| Line Number (table) and Hilight Lines | ✅ |
|
||||
| Line Number (true) and Hilight Lines | ✅ |
|
||||
| Line Number (inline) and Hilight Lines | ✅ |
|
||||
| Line Number (false) and Hilight Lines | ✅ |
|
||||
| Line Number (table) and Hilight Lines and Anchor Line | ✅ |
|
||||
| Line Number (table) and Hilight Inline | ✅ |
|
||||
| Highlight Shortcode, Line Number (table) and Hilight Lines and Anchor | ✅ |
|
||||
| Highlight Shortcode, Line Number (inline) and Hilight Lines and Anchor | ✅ |
|
||||
| Highlight Shortcode, Line Number (false) and Hilight Lines and Anchor | ✅ |
|
||||
| Mermaid Support (No Config, Lazy Load, Dark/Light Auto Switch) | ✅ |
|
||||
| MathJax Support (No Config, Lazy Load, Dark/Light Auto Switch) | ✅ |
|
||||
| Giscus Support (Dark/Light Auto Switch) | ✅ |
|
||||
| Umami Support (Dark/Light Auto Switch) | ✅ |
|
||||
| Multi-Author Support | ✅ |
|
||||
| Multi-Language Support | ✅ |
|
||||
| Support for \<code\> tag | ✅ |
|
||||
| Support for \<pre\> tag | ✅ |
|
||||
| Support for \<kbd\> tag | ✅ |
|
||||
| Support for \<mark\> tag | ✅ |
|
||||
| Passed CodePreKbdMark test | ✅ |
|
||||
| Passed All 8 Summary Rendering Tests | ✅ 8/8 |
|
||||
| Mermaid dark/light manual switch | ✅ |
|
||||
| Mermaid dark/light auto switch | ✅ |
|
81
README.md
81
README.md
@ -2,44 +2,99 @@
|
||||
|
||||
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
|
||||
- Dark / Light mode
|
||||
- Dark / Light mode (Automatic switch based on system settings)
|
||||
- Table of Contents
|
||||
- Comment Support (Giscus, Disque, ISSO, Utterances, GraphComment)
|
||||
- Analytics (Google, Umami)
|
||||
- RSS feeds
|
||||
- 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
|
||||
```
|
||||
|
||||
### Run your site
|
||||
That's all, let's configure anubis2.
|
||||
|
||||
In order to see your site in action, run Hugo's built-in local server.
|
||||
### Configure your site
|
||||
|
||||
`$ hugo server`
|
||||
Don't be panic, configure Anubis2 is really **simple**.
|
||||
|
||||
Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your browser.
|
||||
**This is the minimum configuration:**
|
||||
|
||||
```toml
|
||||
baseURL = "https://hugo-theme-anubis2.netlify.app/"
|
||||
languageCode = "en-us"
|
||||
theme = "anubis2"
|
||||
title = "Anubis2 Demo Site"
|
||||
|
||||
[params.author]
|
||||
name = "Junyi"
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true # true | false; Enable unsafe mode to have a better experience
|
||||
|
||||
[markup.highlight]
|
||||
style = 'base16-snazzy' # Chroma style, find more at here: https://swapoff.org/chroma/playground/
|
||||
|
||||
```
|
||||
|
||||
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))
|
||||
|
||||
In the other way, you can check out the example site's [configuration file](exampleSiteMultilingual/hugo.toml)
|
||||
|
||||
## Run your site
|
||||
|
||||
In order to see your site, run Hugo's built-in local server.
|
||||
|
||||
```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,16 +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: auto;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
/* <code> tag */
|
||||
code {
|
||||
font-size: 14.4px; /* 18px * 0.6 */
|
||||
font-size: 14.4px;
|
||||
/* 18px * 0.6 */
|
||||
padding: 0.1em 0.3em;
|
||||
}
|
||||
|
||||
@ -203,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;
|
||||
@ -212,8 +221,74 @@ pre kbd kbd {
|
||||
margin-right: 0.2em;
|
||||
}
|
||||
|
||||
/* ```python``` like */
|
||||
pre code {
|
||||
p code,
|
||||
p kbd {
|
||||
padding: 0.1em 0.3em;
|
||||
/* top, bottom */
|
||||
/* margin-right: 4px; */
|
||||
}
|
||||
|
||||
td pre {
|
||||
border: none;
|
||||
/* padding: 0px; */
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
td:first-child pre {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
td:last-child pre {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
td pre code {
|
||||
/* when there is a line number grid */
|
||||
padding: 0px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 0px;
|
||||
/* padding-top: 4px; */
|
||||
/* padding-bottom: 4px; */
|
||||
}
|
||||
|
||||
div.highlight {
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--pre-border-color);
|
||||
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 */
|
||||
/* padding-left: 10px; */
|
||||
/* padding-right: 10px; */
|
||||
/* padding-top: 10px; */
|
||||
/* padding-bottom: 10px; */
|
||||
}
|
||||
|
||||
div.highlight code {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
div.highlight code a:hover,
|
||||
div.highlight code a:focus {
|
||||
color: white;
|
||||
border-bottom: 1px solid white;
|
||||
/*for markup.highlight.anchorLineNos = true*/
|
||||
}
|
||||
|
||||
pre code,
|
||||
pre kbd {
|
||||
color: inherit;
|
||||
background-color: inherit;
|
||||
border: none;
|
||||
@ -679,6 +754,8 @@ code.has-jax {
|
||||
.post-translations>li:not(:last-child)::after {
|
||||
content: "|";
|
||||
display: inline-block;
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.post-translations>li a {
|
||||
@ -794,33 +871,30 @@ ul.footer-menu>li {
|
||||
/* Copy code */
|
||||
.highlight {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.highlight pre {
|
||||
padding-right: 75px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.highlight:hover .highlight-copy-btn {
|
||||
display: inline-block;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.highlight-copy-btn {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 2px;
|
||||
border: 0;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.5);
|
||||
border-radius: 6px;
|
||||
padding: 1px;
|
||||
font-size: 0.7em;
|
||||
line-height: 1.8;
|
||||
color: #fff;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
min-width: 25px;
|
||||
min-width: 22px;
|
||||
text-align: center;
|
||||
transition: border 0.3s;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.highlight-copy-btn:hover {
|
||||
@ -888,4 +962,4 @@ ul.footer-menu>li {
|
||||
.post-pagination .pagination-item {
|
||||
max-width: 10em;
|
||||
}
|
||||
}
|
||||
}
|
@ -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,62 +0,0 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Advanced Usage of code, pre, kbd"
|
||||
date = "2024-04-09"
|
||||
description = "Guide to advanced usage of Anubis2"
|
||||
tags = [
|
||||
"emoji",
|
||||
]
|
||||
+++
|
||||
|
||||
`code` <pre>pre</pre>
|
||||
|
||||
<kbd>CRTL</kbd> + <kbd>K</kbd> + <kbd>B</kbd> + <kbd>D</kbd>
|
||||
<!--more-->
|
||||
|
||||
## \<code\>
|
||||
|
||||
<code>Direct Code</code>
|
||||
|
||||
`A verrrrrryyyyy llloooonnnggg coooodeeee`
|
||||
|
||||
`code` `is` `here`
|
||||
|
||||
```plain
|
||||
multiline
|
||||
code
|
||||
here
|
||||
```
|
||||
|
||||
```typescript
|
||||
interface User {
|
||||
id: number
|
||||
firstName: string
|
||||
lastName: string
|
||||
role: string
|
||||
}
|
||||
|
||||
function updateUser(id: number, update: Partial<User>) {
|
||||
const user = getUser(id)
|
||||
const newUser = { ...user, ...update }
|
||||
saveUser(id, newUser)
|
||||
}
|
||||
```
|
||||
|
||||
## \<pre\>
|
||||
|
||||
<pre>pre text</pre>
|
||||
<pre>pre text</pre>
|
||||
<pre>pre text</pre>
|
||||
|
||||
## \<kbd\>
|
||||
|
||||
|
||||
<p>Press <kbd>CTRL</kbd> + <kbd>C</kbd> to copy text (Windows).</p>
|
||||
|
||||
<p>Press <kbd>CMD</kbd> + <kbd>C</kbd> to copy text (Mac OS).</p>
|
||||
|
||||
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.
|
||||
|
||||
<pre>Press <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd> to end the session.</pre>
|
120
exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md
Normal file
120
exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md
Normal file
@ -0,0 +1,120 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Demo - Support for code, pre, kbd, mark"
|
||||
date = "2024-04-30"
|
||||
description = "Guide to advanced usage of Anubis2"
|
||||
tags = [
|
||||
"emoji",
|
||||
]
|
||||
+++
|
||||
|
||||
## Individual support for code, pre, kbd, mark
|
||||
|
||||
`code` <pre>pre</pre>
|
||||
|
||||
<kbd>CRTL</kbd> + <kbd>K</kbd> + <kbd>B</kbd> + <kbd>D</kbd>
|
||||
|
||||
<!--more-->
|
||||
|
||||
Feel free to switch between the light and dark themes to see the rendering differences.
|
||||
|
||||
### Support for \<code\> tag
|
||||
|
||||
<code>Direct Code</code>
|
||||
|
||||
`A verrrrrryyyyy llloooonnnggg coooodeeee`
|
||||
|
||||
`code` `is` `here`
|
||||
|
||||
```plain
|
||||
multiline
|
||||
code
|
||||
here
|
||||
```
|
||||
|
||||
```typescript
|
||||
// ```typescript
|
||||
interface User {
|
||||
id: number
|
||||
firstName: string
|
||||
lastName: string
|
||||
role: string
|
||||
}
|
||||
```
|
||||
|
||||
```typescript {linenos=inline}
|
||||
// ```typescript {linenos=inline}
|
||||
function updateUser(id: number, update: Partial<User>) {
|
||||
const user = getUser(id)
|
||||
const newUser = { ...user, ...update }
|
||||
saveUser(id, newUser)
|
||||
}
|
||||
```
|
||||
|
||||
```typescript {linenos=true}
|
||||
// ```typescript {linenos=true}
|
||||
function updateUser(id: number, update: Partial<User>) {
|
||||
const user = getUser(id)
|
||||
const newUser = { ...user, ...update }
|
||||
saveUser(id, newUser)
|
||||
}
|
||||
```
|
||||
|
||||
### Support for \<pre\> tag
|
||||
|
||||
<pre>pre text</pre>
|
||||
<pre>pre text</pre>
|
||||
<pre>pre text</pre>
|
||||
|
||||
### Support for \<kbd\> tag
|
||||
|
||||
|
||||
<p>Press <kbd>CTRL</kbd> + <kbd>C</kbd> to copy text (Windows).</p>
|
||||
|
||||
<p>Press <kbd>CMD</kbd> + <kbd>C</kbd> to copy text (Mac OS).</p>
|
||||
|
||||
Press <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd> to end the session.
|
||||
|
||||
|
||||
### Support for \<mark\> tag
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
|
||||
### Support for \<kbd\> in \<pre\>
|
||||
|
||||
<pre>This is a <kbd>KBD</kbd> inside a pre. </pre>
|
||||
|
||||
### Support for \<kbd\> in \<code\> (❌ Should not be used)
|
||||
|
||||
<code>This is a <kbd>KBD</kbd> inside a code. </code>
|
||||
|
||||
### Support for \<code\> in \<pre\> (❌ Should not be used)
|
||||
|
||||
<pre>This is a <code>CODE</code> inside a pre. </pre>
|
||||
|
||||
### Support for \<code\> in \<kbd\> (❌ Should not be used)
|
||||
|
||||
<kbd>This is a <code>CODE</code> inside a kbd. </kbd>
|
||||
|
||||
### Support for \<pre\> in \<kbd\> (❌ Should not be used)
|
||||
|
||||
<kbd>This is a <pre>PRE</pre> inside a kbd. </kbd>
|
||||
|
||||
### Support for \<pre\> in \<code\> (❌ Should not be used)
|
||||
|
||||
<code>This is a <pre>PRE</pre> inside a code. </code>
|
||||
|
||||
### Support for \<mark\> in \<kbd\>
|
||||
|
||||
<kbd>This is a <mark>MARK</mark> inside a kbd. </kbd>
|
||||
|
||||
### Support for \<mark\> in \<code\>
|
||||
|
||||
<code>This is a <mark>MARK</mark> inside a code. </code>
|
||||
|
||||
### Support for \<mark\> in \<pre\>
|
||||
|
||||
<pre>This is a <mark>MARK</mark> inside a pre. </pre>
|
@ -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,13 +1,15 @@
|
||||
+++
|
||||
author = "Hugo Authors"
|
||||
title = "Advanced Usage of Diagrams"
|
||||
date = "2024-04-09"
|
||||
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
|
||||
@ -23,7 +25,7 @@ gantt
|
||||
|
||||
```
|
||||
|
||||
Get more examples at [here](https://mermaid.js.org/intro/)
|
||||
Get more examples at [About Mermaid](https://mermaid.js.org/intro/)
|
||||
|
||||
<!--more-->
|
||||
|
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
|
||||
```
|
206
exampleSiteMultilingual/content/posts/demo-multiline-codes.md
Normal file
206
exampleSiteMultilingual/content/posts/demo-multiline-codes.md
Normal file
@ -0,0 +1,206 @@
|
||||
+++
|
||||
author = "Junyi"
|
||||
title = "Demo - Multiline Codes"
|
||||
date = "2024-04-23"
|
||||
description = "Codes, Codefences, and Syntax Highlighting."
|
||||
tags = [
|
||||
"icons",
|
||||
"anubis2",
|
||||
"hugo"
|
||||
]
|
||||
+++
|
||||
|
||||
```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-->
|
||||
|
||||
## Line Numbers, Highlight Lines
|
||||
|
||||
### Line Number (table) and Highlight Lines
|
||||
|
||||
`linenos=table` will give copy-and-paste friendly code blocks.
|
||||
|
||||
```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```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;
|
||||
}
|
||||
```
|
||||
|
||||
### Line Number (true) and Highlight Lines
|
||||
|
||||
```c {linenos=true, hl_lines=[1,"3-4",8], linenostart=1}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```c {linenos=true, hl_lines=[1,"3-4",8], linenostart=1}
|
||||
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;
|
||||
}
|
||||
```
|
||||
|
||||
### Line Number (inline) and Highlight Lines
|
||||
|
||||
```c {linenos=inline, hl_lines=[1,"3-4",8], linenostart=1}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```c {linenos=inline, hl_lines=[1,"3-4",8], linenostart=1}
|
||||
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;
|
||||
}
|
||||
```
|
||||
|
||||
### Line Number (false) and Highlight Lines
|
||||
|
||||
`linenos=false` will turn off line numbers if it’s configured to be on in site configuration.
|
||||
|
||||
```c {linenos=false, hl_lines=[1,"3-4",8]}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```c {linenos=false, hl_lines=[1,"3-4",8]}
|
||||
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;
|
||||
}
|
||||
```
|
||||
|
||||
## Anchor, Inline, Shortcode
|
||||
|
||||
### Line Number (table) and Highlight Lines and Anchor
|
||||
|
||||
Now you can click on the line number to get a link to that line.
|
||||
|
||||
```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199, anchorlinenos=true}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199, anchorlinenos=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;
|
||||
}
|
||||
```
|
||||
|
||||
### Highlight Inline are not supported by Anubis2 ❌
|
||||
|
||||
```c {linenos=true,hl_lines=[1,3,5], hl_inline=true}
|
||||
// codes ...
|
||||
```
|
||||
|
||||
```c {linenos=true,hl_lines=[1,3,5], hl_inline=true}
|
||||
int main() {
|
||||
int a = 1;
|
||||
if (a == 999)
|
||||
// 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" */>}}
|
||||
// codes
|
||||
{{</* /highlight */>}}
|
||||
|
||||
{{< highlight c "linenos=table,hl_lines=1 3-4 8, anchorlinenos=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;
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
||||
### Highlight shortcode, with Line Number (inline), with Highlight Lines and Anchor
|
||||
|
||||
{{</* highlight c "linenos=inline,hl_lines=1 3-4 8, anchorlinenos=true" */>}}
|
||||
// codes
|
||||
{{</* /highlight */>}}
|
||||
|
||||
{{< highlight c "linenos=inline,hl_lines=1 3-4 8, anchorlinenos=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;
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
||||
### Highlight shortcode, No Line Number, With Highlight Lines and Anchor
|
||||
|
||||
{{</* highlight c "linenos=false,hl_lines=1 3-4 8, anchorlinenos=true" */>}}
|
||||
// codes
|
||||
{{</* /highlight */>}}
|
||||
|
||||
{{< highlight c "linenos=false,hl_lines=1 3-4 8, anchorlinenos=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;
|
||||
}
|
||||
{{< / highlight >}} -->
|
@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 1 (😃 Easy)"
|
||||
date: 2024-04-25T1:54:12+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
This is a summary rendering test.
|
||||
|
||||
## Test Heading
|
||||
|
||||
<!--more-->
|
||||
`<!--more-->` is applied here.
|
||||
|
||||
## Test Heading Again
|
||||
|
||||
The content below should be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 2 (😏 Easy)"
|
||||
date: 2024-04-25T1:54:13+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
|
||||
<mark>You should not see this line in preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 3 (🤔 Easy)"
|
||||
date: 2024-04-25T1:54:14+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
```c
|
||||
int main() {
|
||||
return 0; // Only see this in the summary view
|
||||
}
|
||||
```
|
||||
|
||||
<!--more-->
|
||||
|
||||
<mark>You MUST NOT see me in the preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 4 (😅 Easy?)"
|
||||
date: 2024-04-25T1:54:15+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
## Hi, can you see "aaa" in the summary?
|
||||
|
||||
aaa
|
||||
|
||||
<!--<!--more-->
|
||||
|
||||
<mark>You MUST NOT see me in the preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 5 (😥 Medium)"
|
||||
date: 2024-04-25T1:54:16+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
```c
|
||||
int main() {
|
||||
return 0; // <!--more--> Only see this in the summary view
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
<mark>You MUST NOT see me in the preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 6 (🤯 Hard)"
|
||||
date: 2024-04-25T1:54:17+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
```c {linenos=inline}
|
||||
int main() {
|
||||
// Is your theme able to handle this?
|
||||
// Are the content below rendered correctly?
|
||||
return 0; // Only see this in the summary view
|
||||
}
|
||||
```
|
||||
|
||||
<!--<!--more-->
|
||||
|
||||
<mark>You MUST NOT see me in the preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 7 (😱 Bad Dream)"
|
||||
date: 2024-04-25T1:54:18+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
|
||||
```c {linenos=table}
|
||||
int main() {
|
||||
// Is your theme able to handle this?
|
||||
// Are the content below rendered correctly?
|
||||
return 0; // Only see this in the summary view
|
||||
}
|
||||
```
|
||||
|
||||
<!--<!--more-->
|
||||
|
||||
<mark>You MUST NOT see me in the preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "Demo - Summary Rendering Test 8 (💀 Nightmare)"
|
||||
date: 2024-04-25T1:54:19+08:00
|
||||
draft: true
|
||||
hidden: true
|
||||
tags: [Hugo]
|
||||
---
|
||||
<!--<!--more-->
|
||||
```c {linenos=table}
|
||||
int main() {
|
||||
// Is your theme able to handle this? <!--<!--more-->
|
||||
// Are the content below rendered correctly? <!--more-->
|
||||
return 0; // Only see this in the summary view
|
||||
}
|
||||
```
|
||||
|
||||
<!--<!--more-->
|
||||
|
||||
<mark>You MUST NOT see me in the preview</mark>
|
||||
|
||||
## Test Heading
|
||||
|
||||
The content below should also be hidden in the summary view.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```html
|
||||
Will <!--<!--more--> cause a rendering issue?
|
||||
```
|
@ -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.
|
||||
|
58
exampleSiteMultilingual/content/posts/icons.md
Normal file
58
exampleSiteMultilingual/content/posts/icons.md
Normal file
@ -0,0 +1,58 @@
|
||||
+++
|
||||
author = "Junyi"
|
||||
title = "Demo - Social Icons"
|
||||
date = "2024-05-05"
|
||||
description = "Guide to using social icons supported by Anubis2."
|
||||
tags = [
|
||||
"icons",
|
||||
"anubis2",
|
||||
"hugo"
|
||||
]
|
||||
+++
|
||||
|
||||
To use an icon, simply copy its shortcode and paste it into your content where you want the icon to appear. The shortcode must be enclosed in `{{</* */>}}`.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Here is a list of available icons, their shortcodes, and what they look like when rendered:
|
||||
|
||||
|
||||
| name | shortcode | icon |
|
||||
| ---------- | ---------------------------------- | ---------------------------- |
|
||||
| 4chan | `{{</* icon "4chan" */>}}` | {{< icon "4chan" >}} |
|
||||
| leetcode | `{{</* icon "leetcode" */>}}` | {{< icon "leetcode" >}} |
|
||||
| qq | `{{</* icon "qq" */>}}` | {{< icon "qq" >}} |
|
||||
| spotify | `{{</* icon "spotify" */>}}` | {{< icon "spotify" >}} |
|
||||
| tinder | `{{</* icon "tinder" */>}}` | {{< icon "tinder" >}} |
|
||||
| youtube | `{{</* icon "youtube" */>}}` | {{< icon "youtube" >}} |
|
||||
| docs | `{{</* icon "docs" */>}}` | {{< icon "docs" >}} |
|
||||
| linkedin | `{{</* icon "linkedin" */>}}` | {{< icon "linkedin" >}} |
|
||||
| reddit | `{{</* icon "reddit" */>}}` | {{< icon "reddit" >}} |
|
||||
| steam | `{{</* icon "steam" */>}}` | {{< icon "steam" >}} |
|
||||
| tumblr | `{{</* icon "tumblr" */>}}` | {{< icon "tumblr" >}} |
|
||||
| zhihu | `{{</* icon "zhihu" */>}}` | {{< icon "zhihu" >}} |
|
||||
| email | `{{</* icon "email" */>}}` | {{< icon "email" >}} |
|
||||
| mastodon | `{{</* icon "mastodon" */>}}` | {{< icon "mastodon" >}} |
|
||||
| rss | `{{</* icon "rss" */>}}` | {{< icon "rss" >}} |
|
||||
| teams | `{{</* icon "teams" */>}}` | {{< icon "teams" >}} |
|
||||
| twitch | `{{</* icon "twitch" */>}}` | {{< icon "twitch" >}} |
|
||||
| facebook | `{{</* icon "facebook" */>}}` | {{< icon "facebook" >}} |
|
||||
| medium | `{{</* icon "medium" */>}}` | {{< icon "medium" >}} |
|
||||
| skype | `{{</* icon "skype" */>}}` | {{< icon "skype" >}} |
|
||||
| telegram | `{{</* icon "telegram" */>}}` | {{< icon "telegram" >}} |
|
||||
| twitter | `{{</* icon "twitter" */>}}` | {{< icon "twitter" >}} |
|
||||
| github | `{{</* icon "github" */>}}` | {{< icon "github" >}} |
|
||||
| netease | `{{</* icon "netease-music" */>}}` | {{< icon "netease-music" >}} |
|
||||
| slack | `{{</* icon "slack" */>}}` | {{< icon "slack" >}} |
|
||||
| theme | `{{</* icon "theme-dark" */>}}` | {{< icon "theme-dark" >}} |
|
||||
| vk | `{{</* icon "vk" */>}}` | {{< icon "vk" >}} |
|
||||
| gitlab | `{{</* icon "gitlab" */>}}` | {{< icon "gitlab" >}} |
|
||||
| notion | `{{</* icon "notion" */>}}` | {{< icon "notion" >}} |
|
||||
| snapchat | `{{</* icon "snapchat" */>}}` | {{< icon "snapchat" >}} |
|
||||
| theme | `{{</* icon "theme-light" */>}}` | {{< icon "theme-light" >}} |
|
||||
| weibo | `{{</* icon "weibo" */>}}` | {{< icon "weibo" >}} |
|
||||
| instagram | `{{</* icon "instagram" */>}}` | {{< icon "instagram" >}} |
|
||||
| patreon | `{{</* icon "patreon" */>}}` | {{< icon "patreon" >}} |
|
||||
| soundcloud | `{{</* icon "soundcloud" */>}}` | {{< icon "soundcloud" >}} |
|
||||
| tiktok | `{{</* icon "tiktok" */>}}` | {{< icon "tiktok" >}} |
|
||||
| x | `{{</* icon "x" */>}}` | {{< icon "x" >}} |
|
@ -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>
|
||||
|
||||
|
@ -1,22 +1,27 @@
|
||||
baseURL = "/"
|
||||
languageCode = "en-us"
|
||||
defaultContentLanguage = "en"
|
||||
title = "Anubis2"
|
||||
title = "Anubis2 Demo Site"
|
||||
theme = "anubis2"
|
||||
paginate = 5
|
||||
|
||||
disqusShortname = ""
|
||||
|
||||
[pagination]
|
||||
pagerSize = 5
|
||||
|
||||
[author]
|
||||
|
||||
[params.author]
|
||||
name = "Junyi"
|
||||
email = "me@junyi.dev"
|
||||
location = "Singapore"
|
||||
|
||||
[params]
|
||||
author = "Junyi"
|
||||
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
|
||||
|
||||
@ -25,7 +30,7 @@ readNextPosts = 2
|
||||
copyCodeButton = true
|
||||
rssAsSocialIcon = true
|
||||
locale = "en-us"
|
||||
mathjax = true
|
||||
math = false # true: enable mathjax globally (default is false)
|
||||
toc = true
|
||||
|
||||
# Graphcomment support
|
||||
@ -38,50 +43,21 @@ GiscusCategoryId = "DIC_kwDOLEp76c4CcbPS"
|
||||
GiscusLazyLoad = false
|
||||
GiscusDataMapping = "pathname"
|
||||
|
||||
customCSS = ["css/custom1.scss", "css/custom2.css"]
|
||||
customCSS = ["custom-css/custom1.scss", "custom-css/custom2.css"]
|
||||
|
||||
[[params.social]]
|
||||
id = "docs"
|
||||
url = "https://gohugo.io/documentation/"
|
||||
|
||||
[[params.social]]
|
||||
id = "github"
|
||||
url = "https://github.com/Junyi-99/hugo-theme-anubis2"
|
||||
|
||||
[[params.social]]
|
||||
id = "linkedin"
|
||||
url = "https://www.linkedin.com/"
|
||||
|
||||
[[params.social]]
|
||||
id = "email"
|
||||
url = "example@example.com"
|
||||
|
||||
[[params.social]]
|
||||
id = "facebook"
|
||||
url = "#"
|
||||
|
||||
[[params.social]]
|
||||
id = "instagram"
|
||||
url = "#"
|
||||
|
||||
[[params.social]]
|
||||
id = "netease-music"
|
||||
url = "#"
|
||||
|
||||
[[params.social]]
|
||||
id = "telegram"
|
||||
url = "#"
|
||||
|
||||
[[params.social]]
|
||||
id = "x"
|
||||
url = "#"
|
||||
|
||||
[[params.social]]
|
||||
id = "youtube"
|
||||
url = "#"
|
||||
|
||||
[languages.en]
|
||||
languageName = "English"
|
||||
social = [
|
||||
{ id = "docs", url = "https://gohugo.io/documentation/" },
|
||||
{ id = "github", url = "https://github.com/Junyi-99/hugo-theme-anubis2" },
|
||||
{ id = "linkedin", url = "https://www.linkedin.com/" },
|
||||
{ id = "email", url = "example@example.com" },
|
||||
{ id = "facebook", url = "#" },
|
||||
{ id = "instagram", url = "#" },
|
||||
{ id = "netease-music", url = "#" },
|
||||
{ id = "telegram", url = "#" },
|
||||
{ id = "x", url = "#" },
|
||||
{ id = "youtube", url = "#" },
|
||||
{ id = "bluesky", url = "#" }
|
||||
]
|
||||
|
||||
[[menu.main]]
|
||||
identifier = "home"
|
||||
@ -107,10 +83,13 @@ identifier = "archive"
|
||||
url = "/posts/"
|
||||
weight = 4
|
||||
|
||||
[languages]
|
||||
[languages.en]
|
||||
languageName = "English"
|
||||
|
||||
[languages.pl]
|
||||
languageName = "Polski"
|
||||
|
||||
|
||||
[[languages.pl.menu.main]]
|
||||
identifier = "home"
|
||||
name = "Strona Główna"
|
||||
@ -173,14 +152,27 @@ category = "categories"
|
||||
tag = "tags"
|
||||
author = "authors"
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
[markup]
|
||||
defaultMarkdownHandler = 'goldmark'
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
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 = '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"
|
||||
|
||||
[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>
|
||||
|
@ -22,8 +22,13 @@
|
||||
|
||||
</article>
|
||||
|
||||
{{ if gt .Site.Params.readNextPosts 0 }}
|
||||
{{ $related := .Site.RegularPages.Related . | first .Site.Params.readNextPosts }}
|
||||
{{ $readNextPosts := 3}}
|
||||
{{ if site.Params.readNextPosts }}
|
||||
{{ $readNextPosts = site.Params.readNextPosts }}
|
||||
{{ end }}
|
||||
|
||||
{{ if gt $readNextPosts 0 }}
|
||||
{{ $related := .Site.RegularPages.Related . | first $readNextPosts }}
|
||||
{{ with $related }}
|
||||
<h3 class="read-next-title noselect">{{ i18n "readNext" }}</h3>
|
||||
<ul class="read-next-posts noselect">
|
||||
@ -48,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.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}
|
||||
{{ if .Site.Params.UmamiAnalytics.shareUrl }}
|
||||
<a 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>
|
@ -22,14 +22,16 @@
|
||||
{{ partial "favicons.html" . }}
|
||||
|
||||
{{ $colorTheme := "light" }}
|
||||
{{ $colorThemeSwitcher := false }}
|
||||
{{ $colorThemeSwitcher := true }}
|
||||
|
||||
{{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }}
|
||||
{{ $colorTheme = site.Params.colortheme | lower }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and (isset site.Params "colorthemeswitcher") }}
|
||||
{{ if isset site.Params "colorthemeswitcher" }}
|
||||
{{ $colorThemeSwitcher = site.Params.colorthemeswitcher }}
|
||||
{{ else }}
|
||||
{{ $colorThemeSwitcher = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }}
|
||||
@ -57,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 }}
|
||||
|
||||
@ -101,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 ) }}
|
||||
|
@ -20,6 +20,7 @@
|
||||
<nav></nav>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.mathjax }}{{ partial "mathjax_support.html" . }}{{ end }}
|
||||
{{/* .Params is the current page config. .Site.Params is globall config in hugo.toml */}}
|
||||
{{ if or .Site.Params.math .Params.math }}{{ partial "mathjax_support.html" . }}{{ end }}
|
||||
|
||||
{{ partial "header-extra.html" . }}
|
||||
|
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,4 +1,4 @@
|
||||
<ul class="social-icons">
|
||||
<ul class="social-icons noselect">
|
||||
|
||||
{{ range $.Site.Params.Social }}
|
||||
{{ if and (isset $.Site.Data.social.social_icons .id) (isset . "url") }}
|
||||
@ -24,7 +24,12 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.rssAsSocialIcon }}
|
||||
{{ $rssIcon := true }}
|
||||
{{ if isset .Site.Params "rssIcon" }}
|
||||
{{ $rssIcon = .Site.Params.rssIcon }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $rssIcon }}
|
||||
{{ with .Site.Home.OutputFormats.Get "rss" -}}
|
||||
<li>
|
||||
<a {{ printf "href=%q" .RelPermalink | safeHTMLAttr }} title="RSS" rel="me">
|
||||
|
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,16 +1,16 @@
|
||||
{{ $colorTheme := "light" }}
|
||||
{{ $colorThemeSwitcher := false }}
|
||||
{{ $colorThemeSwitcher := true }}
|
||||
|
||||
{{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }}
|
||||
{{ $colorTheme = site.Params.colortheme | lower }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and (isset site.Params "colorthemeswitcher") }}
|
||||
{{ if isset site.Params "colorthemeswitcher" }}
|
||||
{{ $colorThemeSwitcher = site.Params.colorthemeswitcher }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }}
|
||||
{{ if site.Params.colorthemeswitcher }}
|
||||
{{ if $colorThemeSwitcher }}
|
||||
<div class="theme-switcher">
|
||||
{{ partial "font-awesome.html" (dict "iconName" "theme-light" "custom" false) }}
|
||||
</div>
|
||||
|
@ -1,6 +1,11 @@
|
||||
{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }}
|
||||
{{ $toc := true }}
|
||||
{{ if isset .Params "toc" }}
|
||||
{{ $toc = .Params.toc }}
|
||||
{{ else }}
|
||||
{{ $toc = ge .WordCount .Site.Params.tocWordCount }}
|
||||
{{ if and (isset .Site.Params "toc") (not (.Site.Params.toc)) }}
|
||||
{{ $toc = false }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
1
layouts/shortcodes/icon.html
Normal file
1
layouts/shortcodes/icon.html
Normal file
@ -0,0 +1 @@
|
||||
{{ partial (print "tabler-icons/" (.Get 0) ".svg" ) . }}
|
@ -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