diff --git a/.gitignore b/.gitignore index 0c376ea..d298be1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -public/ -.DS_Store +public/ \ No newline at end of file diff --git a/README.md b/README.md index 4c7125c..70be5e4 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,10 @@ Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo.io/), check our [Demo](https://www.junyi.dev/). -![image](https://github.com/Junyi-99/hugo-theme-anubis2/assets/14367694/8d9a591b-e168-4328-a770-eb2e8f04f657) - -| Light | Dark (Code) | Dark (Math) | -| :------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: | -| demo1 | demo3 | demo2 | - - -> [!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. +> 📝 Please note that anubis2 is under active maintenance, so please REMEMBER to keep your theme up to date! > -> Check the [Anubis2 template](https://github.com/Junyi-99/hugo-theme-anubis2/tree/main/exampleSiteMultilingual) for the latest config file. - +![image](https://github.com/Junyi-99/hugo-theme-anubis2/assets/14367694/8d9a591b-e168-4328-a770-eb2e8f04f657) ## Highlighted Features @@ -30,25 +18,21 @@ Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo - Mobile Support - [Full Features](wiki/Full-Features) -## Installation & Configuration +## Installation You need to install an extended version of Hugo to run this theme. -For more information read the [official setup guide of Hugo](https://gohugo.io/installation/). +### As Git Submodule -### Install theme as Git Submodule +Inside the folder of your Hugo site run: -Inside the folder of your Hugo site, run: + $ git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2 -```bash -git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2 -``` - -That's all, let's configure anubis2. +For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo. ### Configure your site -Don't be panic, configure Anubis2 is really **simple**. +Don't be panic, configure Anubis2 is relatively simple. **This is the minimum configuration:** @@ -58,43 +42,29 @@ languageCode = "en-us" theme = "anubis2" title = "Anubis2 Demo Site" -[params.author] +[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/ - +style = 'base16-snazzy' # Highlight.js style ``` -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)) +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)) -In the other way, you can check out the example site's [configuration file](exampleSiteMultilingual/hugo.toml) +### Run your site -## Run your site +In order to see your site in action, run Hugo's built-in local server. -In order to see your site, run Hugo's built-in local server. +`$ hugo 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 -``` +Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your browser. ## 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 diff --git a/assets/css/main.css b/assets/css/main.css index 5a56b46..da76a9c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -154,20 +154,14 @@ 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.25em 0.5em; + padding: 0.5em 1em; border: 1px double var(--table-border-color); - } /* Code */ @@ -181,18 +175,15 @@ 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; } /* tag */ code { - font-size: 14.4px; - /* 18px * 0.6 */ + font-size: 14.4px; /* 18px * 0.6 */ padding: 0.1em 0.3em; } @@ -211,8 +202,7 @@ 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; @@ -258,16 +248,11 @@ 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; */ @@ -277,7 +262,6 @@ div.highlight pre { div.highlight code { padding-left: 0px; padding-right: 0px; - overflow: unset; } div.highlight code a:hover, diff --git a/data/social.yaml b/data/social.yaml index 9e78db2..65e0ba3 100644 --- a/data/social.yaml +++ b/data/social.yaml @@ -16,7 +16,6 @@ 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 diff --git a/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md b/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md index 280fa88..7e024a4 100644 --- a/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md +++ b/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md @@ -1,7 +1,7 @@ +++ author = "Hugo Authors" title = "Demo - Support for code, pre, kbd, mark" -date = "2024-04-30" +date = "2024-04-22" description = "Guide to advanced usage of Anubis2" tags = [ "emoji", diff --git a/exampleSiteMultilingual/content/posts/demo-diagram/index.md b/exampleSiteMultilingual/content/posts/demo-diagram.md similarity index 99% rename from exampleSiteMultilingual/content/posts/demo-diagram/index.md rename to exampleSiteMultilingual/content/posts/demo-diagram.md index 7a09429..47d9852 100644 --- a/exampleSiteMultilingual/content/posts/demo-diagram/index.md +++ b/exampleSiteMultilingual/content/posts/demo-diagram.md @@ -1,7 +1,7 @@ +++ author = "Hugo Authors" title = "Demo - Support for Diagrams" -date = "2024-05-06" +date = "2024-04-19" description = "Guide to advanced usage of Anubis2" tags = [ "emoji", diff --git a/exampleSiteMultilingual/content/posts/demo-diagram/icon.svg b/exampleSiteMultilingual/content/posts/demo-diagram/icon.svg deleted file mode 100644 index 8be86aa..0000000 --- a/exampleSiteMultilingual/content/posts/demo-diagram/icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md b/exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md deleted file mode 100644 index 7a09429..0000000 --- a/exampleSiteMultilingual/content/posts/demo-diagram/index.zh.md +++ /dev/null @@ -1,110 +0,0 @@ -+++ -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/) - - - -```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
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 -``` diff --git a/exampleSiteMultilingual/content/posts/demo-multiline-codes.md b/exampleSiteMultilingual/content/posts/demo-multiline-codes.md index ed32b63..e3df562 100644 --- a/exampleSiteMultilingual/content/posts/demo-multiline-codes.md +++ b/exampleSiteMultilingual/content/posts/demo-multiline-codes.md @@ -10,31 +10,7 @@ tags = [ ] +++ -```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` +There are 9 tests. @@ -69,7 +45,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; @@ -126,34 +102,30 @@ 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; } ``` -### Highlight Inline are not supported by Anubis2 ❌ +### Line Number (table) and Highlight Inline (❌ Not supported by Anubis2) - ```c {linenos=true,hl_lines=[1,3,5], hl_inline=true} + ```c {linenos=true,hl_lines=[1,"3-4",8], hl_inline=true} // codes ... ``` -```c {linenos=true,hl_lines=[1,3,5], hl_inline=true} +```c {linenos=true,hl_lines=[1,"3-4",8], 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; } ``` - - +{{< / highlight >}} diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md index 6f1f432..7670383 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 1 (😃 Easy)" date: 2024-04-25T1:54:12+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md index e267eef..6d051f4 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 2 (😏 Easy)" date: 2024-04-25T1:54:13+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md index fcd583e..8b0b1e9 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 3 (🤔 Easy)" date: 2024-04-25T1:54:14+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md index 1448209..1400d39 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 4 (😅 Easy?)" date: 2024-04-25T1:54:15+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md index 7a7db68..7b9673f 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 5 (😥 Medium)" date: 2024-04-25T1:54:16+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md index 118a5e4..1ad288c 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 6 (🤯 Hard)" date: 2024-04-25T1:54:17+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md index d10f475..add4a4d 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 7 (😱 Bad Dream)" date: 2024-04-25T1:54:18+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md index 095240e..27c02f7 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md @@ -2,7 +2,6 @@ title: "Demo - Summary Rendering Test 8 (💀 Nightmare)" date: 2024-04-25T1:54:19+08:00 draft: true -hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/emoji-support.md b/exampleSiteMultilingual/content/posts/emoji-support.md index e16eeeb..119346a 100644 --- a/exampleSiteMultilingual/content/posts/emoji-support.md +++ b/exampleSiteMultilingual/content/posts/emoji-support.md @@ -9,7 +9,7 @@ tags = [ +++ Emoji can be enabled in a Hugo project in a number of ways. - + 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. diff --git a/exampleSiteMultilingual/content/posts/emoji-support.zh.md b/exampleSiteMultilingual/content/posts/emoji-support.zh.md index 3d449e1..5c11cf4 100644 --- a/exampleSiteMultilingual/content/posts/emoji-support.zh.md +++ b/exampleSiteMultilingual/content/posts/emoji-support.zh.md @@ -10,6 +10,8 @@ tags = [ 在 Hugo 博客里,你可以用多种方式使用 Emoji: + + 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. diff --git a/exampleSiteMultilingual/content/posts/icons.md b/exampleSiteMultilingual/content/posts/icons.md index 5f8cd12..0f85c12 100644 --- a/exampleSiteMultilingual/content/posts/icons.md +++ b/exampleSiteMultilingual/content/posts/icons.md @@ -1,7 +1,7 @@ +++ author = "Junyi" title = "Demo - Social Icons" -date = "2024-05-05" +date = "2024-04-23" description = "Guide to using social icons supported by Anubis2." tags = [ "icons", diff --git a/exampleSiteMultilingual/content/posts/markdown-syntax.md b/exampleSiteMultilingual/content/posts/markdown-syntax.md index 076acea..9524293 100644 --- a/exampleSiteMultilingual/content/posts/markdown-syntax.md +++ b/exampleSiteMultilingual/content/posts/markdown-syntax.md @@ -1,7 +1,7 @@ +++ author = "Hugo Authors" title = "Markdown Syntax Guide" -date = "2024-05-07" +date = "2019-03-11" 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. - - ## Headings -The following HTML `

`—`

` elements represent 5 levels of section headings. `

` is the highest section level while `

` is the lowest. +The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. -## H2 +# H1 -You should using `## H2` as your section title, since the file title is `# H1` +You should not use `# H1` in your markdown file, since the title is `#H1`. -If you use `# H1` as your section title, you will get a warning from linter: +If you use, 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,11 +45,9 @@ 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? -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. +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. Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. @@ -63,7 +61,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.

> — Rob Pike[^1] @@ -87,9 +85,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ## Code Blocks -### Code block with backticks and showing highlighted lines +### Code block with backticks -```html {linenos=table, hl_lines=[1,"4-5",8], linenostart=199} +```html @@ -160,6 +158,6 @@ H2O Xn + Yn = Zn -Press CTRL+ALT+Delete to end the session. +Press CTRL+ALT+Delete to end the session. Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/exampleSiteMultilingual/content/posts/math-typesetting.md b/exampleSiteMultilingual/content/posts/math-typesetting.md index 29dbd1c..9d96925 100644 --- a/exampleSiteMultilingual/content/posts/math-typesetting.md +++ b/exampleSiteMultilingual/content/posts/math-typesetting.md @@ -2,15 +2,38 @@ author: Hugo Authors title: Math Typesetting date: 2019-03-08 -description: A brief guide to setup MathJax +description: A brief guide to setup KaTeX math: true --- Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + -- To enable MathJax on a page basis include the parameter `math: true` in content files. +In this example we will be using [KaTeX](https://katex.org/) -## Examples +- 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 }} + + + + +{{ end }} +{{}} + +### Examples Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ diff --git a/exampleSiteMultilingual/content/posts/placeholder-text.md b/exampleSiteMultilingual/content/posts/placeholder-text.md index ac70ed6..1e9ee4e 100644 --- a/exampleSiteMultilingual/content/posts/placeholder-text.md +++ b/exampleSiteMultilingual/content/posts/placeholder-text.md @@ -31,7 +31,7 @@ tractus malis. 4. Arcanaque montibus omnes 5. Quidem et -## Vagus elidunt +# Vagus elidunt diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 58186d6..14e1713 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -3,13 +3,11 @@ languageCode = "en-us" defaultContentLanguage = "en" title = "Anubis2 Demo Site" theme = "anubis2" +paginate = 5 + disqusShortname = "" -[pagination] -pagerSize = 5 - - -[params.author] +[author] name = "Junyi" email = "me@junyi.dev" location = "Singapore" @@ -19,9 +17,6 @@ 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 @@ -55,8 +50,7 @@ social = [ { id = "netease-music", url = "#" }, { id = "telegram", url = "#" }, { id = "x", url = "#" }, - { id = "youtube", url = "#" }, - { id = "bluesky", url = "#" } + { id = "youtube", url = "#" } ] [[menu.main]] @@ -156,23 +150,53 @@ author = "authors" defaultMarkdownHandler = 'goldmark' [markup.goldmark.renderer] -unsafe = true # Enable unsafe mode to have a better experience +unsafe = true [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/ +style = 'base16-snazzy' tabWidth = 4 [params.UmamiAnalytics] enabled = true dnt = false -id = "d01ce82c-c8f4-4714-ba37-ba4899f2a885" # Website ID +id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID datacache = false -url = "https://umami.xtra.science/script.js" -shareUrl = "https://umami.xtra.science/share/Fy0goUn0b9rrxxGe/hugo-theme-anubis2.netlify.app" +url = "https://eu.umami.is/script.js" +shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" -[params.GoogleAnalytics] -enabled = true -gtag = "G-32F16X8HLF" \ No newline at end of file + +# 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 \ No newline at end of file diff --git a/i18n/ce.yaml b/i18n/ce.yaml deleted file mode 100644 index 4c2a054..0000000 --- a/i18n/ce.yaml +++ /dev/null @@ -1,56 +0,0 @@ -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: "хӀа браузер окх видео цан болх ца бо" diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 7dccba1..15a4ed7 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -12,27 +12,9 @@ {{ .RelPermalink }} {{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}} - {{ with .Site.Params.author }} - {{ with .email }} - {{.}} - {{ with $.Site.Params.author.name }} - ({{.}}) - {{end}} - - {{end}} - - {{ with .Site.Params.author.email }} - - {{.}} - {{ with $.Site.Params.author.name }} - ({{.}}) - {{end}} - - {{end}} - {{ end }} - - {{ with .Site.Copyright }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} @@ -43,7 +25,7 @@ {{ .Title }} {{ .RelPermalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Params.author.email }}{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .RelPermalink }} {{ .Content | html }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c16b949..5f466c9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,8 +23,8 @@ {{ $readNextPosts := 3}} - {{ if site.Params.readNextPosts }} - {{ $readNextPosts = site.Params.readNextPosts }} + {{ if isset .Site.Params "readNextPosts" }} + {{ $readNextPosts := .Site.Params.readNextPosts }} {{ end }} {{ if gt $readNextPosts 0 }} @@ -53,10 +53,29 @@ */}} {{ if .Store.Get "hasMermaid" }} - {{ partial "mermaid_support.html" . }} - {{ end }} + {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }} - {{ if .Params.math }} - {{ partial "mathjax_support.html" . }} + {{ $colorTheme := "light" }} + {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} + {{ $colorTheme = site.Params.colortheme | lower }} + {{ end }} + + {{ end }} {{ end }} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 1db96c2..7d4284f 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -2,23 +2,23 @@ {{ range where .Data.Pages "Params.hidden" "!=" true }} - {{- if .Permalink -}} - - {{ .Permalink }}{{ if not .Lastmod.IsZero }} - {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} - {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} - {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} - {{ end }} - {{ end }} - + {{- if .RelPermalink -}} + + {{ .RelPermalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + {{- end -}} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 9330ffd..f134cf2 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -8,7 +8,6 @@ {{ range (.Paginate $pages).Pages }} {{ partial "post-summary.html" . }} {{ end }} - {{ partial "pagination.html" . }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 3e3a652..aae2a24 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if .Site.Config.Services.Disqus.Shortname }} +{{ if .Site.DisqusShortname }} {{ partial "disqus.html" . }} {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 1a0917d..fbff101 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,35 +5,19 @@ {{ end }}