diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 0d8f0c0..e1cf64f 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -30,4 +30,4 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./exampleSite/public - cname: h.xjj.pub \ No newline at end of file + # cname: h.xjj.pub \ No newline at end of file diff --git a/.gitignore b/.gitignore index 96e0abb..551cd43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store public -resources \ No newline at end of file +resources +.hugo_build.lock \ No newline at end of file diff --git a/Makefile b/Makefile index 24c0ae5..4451d6b 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,11 @@ themeDir=../.. .PHONY: dev, build, clean dev: - -rm -r exampleSite/resources hugo server -D -s $(source) --themesDir $(themeDir) --disableFastRender build: hugo -D --gc --minify -s $(source) --themesDir $(themeDir) clean: - rm -r $(source)/public \ No newline at end of file + rm -r $(source)/public + rm -r exampleSite/resources \ No newline at end of file diff --git a/README.md b/README.md index 3e82ffa..18e1afb 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,24 @@ # Minima -A Clean and minimal Hugo theme porting from [Minima on Hexo](https://github.com/adisaktijrs/hexo-theme-minima). [Click me](https://h.xjj.pub/) to take a look at the demo site. +Minima is a clean and minimal Hugo theme originally ported from [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). Check out the [example site](https://mivinci.github.io/hugo-theme-minima). ![screenshot](./images/tn.png) +> Note that the main branch is in development phase, UI or configuration may vary. + + ## Features -- [x] Light/dark mode -- [x] VSCode-style code hightlighting -- [x] KaTeX -- [x] Mermaid -- [x] Google analytics -- [x] Disqus/Utterances comments -- [x] Optional ToC +- [x] 🌗 Dark mode +- [x] 📚 Multilingual mode +- [x] 🏳️‍🌈 Code highlighting - VSCode dark+ +- [x] 🔢 Math - KaTeX +- [x] 💹 Flowcharts - Mermaid +- [x] 🧑‍💻 Comment - Disqus, Utterances, Giscus +- [x] 🔎 Search - FuseJS +- [x] 〽️ Google analytics +- [x] 🔗 External link +- [x] ✉️ RSS ## Usage @@ -20,42 +26,54 @@ Before using Minima, make sure you've got Hugo (extended version) installed on y ### Installation -Suppose `blog` is where you place your sources. +You can use either `git submodule` or `git clone` to fetch this theme into the directory where Hugo places themes. + +#### Git Submodule ```bash -cd blog -git init git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima ``` -Or `clone` directly if you don't wanna use the Git submodule. +#### Git Clone ```bash git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima ``` -Anyways, you just need to put Minima under the `blog/themes` directory. ### Configuration -Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) and edit your own `blog/config.toml` file. +Follow [exampleSite/config.yaml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.yaml) and edit your own one. -### Supported Front Matters +## Supported Front Matters -| Field | Type | Explanation | -| ----------- | ------ | ------------------------------------------------------ | -| title | string | Title of the post, will be rendered in a `h1` tag | -| description | string | Description of the post, will be rendered in a `p` tag | -| date | string | Datetime that the post is written | -| categories | array | Array of categories the posts belongs to | -| series | array | Array of series the post belongs to | -| tags | array | Array of tags the posts is related to | -| math | bool | True if the post needs to render math formulas | -| mermaid | bool | True if the post needs to render mermaid graphs | -| comment | bool | True if the post allows people to make comments | -| draft | bool | True if the post isn't already to production | -| toc | bool | True if the post needs a ToC | +| Attr | Type | Explanation | +|:----------- |:------ |:------------| +| title | string | title | +| description | string | description | +| date | string | creation time | +| categories | array | category list | +| series | array | series list | +| tags | array | tag list | +| math | bool | enables math plugin | +| diagram | bool | enables diagram plugin | +| comment | bool | enable comment plugin | +| draft | bool | disallow being published | +| link | string | a URL to redirect to | -### Feedback + +## Contribution + +I'm currently looking for i18n contributors :) + +## Feedback Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). + +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=mivinci/hugo-theme-minima&type=Date)](https://star-history.com/#star-history/star-history&Date) + +## License + +Hugo Minima is MIT licensed. diff --git a/assets/css/atom.scss b/assets/css/atom.scss new file mode 100644 index 0000000..54fdce1 --- /dev/null +++ b/assets/css/atom.scss @@ -0,0 +1,103 @@ +@mixin breakpoint($k, $v) { + @if $k == "" { + @content; + } + @else { + @media (min-width: $v) { + @content; + } + } +} + +/* classes that breakpoints are necessary for */ +$screens: ("", 0), (sm\:, 640px); +@each $k, $v in $screens { + @include breakpoint($k, $v) { + .#{$k}flex { display: flex; } + + .#{$k}flex-row { flex-direction: row; } + + .#{$k}flex-col { flex-direction: column; } + + .#{$k}flex-col-reverse { flex-direction: column-reverse; } + + .#{$k}justify-between { justify-content: space-between; } + + .#{$k}items-center { align-items: center; } + + .#{$k}items-start { align-items: flex-start; } + + .#{$k}items-end { align-items: flex-end; } + + .#{$k}items-baseline { align-items: baseline; } + + .#{$k}text-center { text-align: center; } + + .#{$k}text-left { text-align: left; } + } +} + +/* layout */ +.container { + max-width: var(--max-w); +} + +.hidden { + display: none; +} + +.overflow-x-auto { + overflow-x: auto; +} + +.overflow-y-hidden { + overflow-y: hidden; +} + +/* spacing */ +$u: 0.25; +@each $i, $class in (p, padding), (m, margin) { + @each $j, $size in (t, top), (r, right), (b, bottom), (l, left) { + @each $k in 0,1,2,3,4,5,6,7,8 { + .#{$i}#{$j}-#{$k} { + #{$class}-#{$size}: #{$u * $k}rem; + } + } + } +} + +.mx-auto { + margin-left: auto; + margin-right: auto; +} + +/* typography */ +$weights: (thin, 100), (extralight, 200), (light, 300), (normal, 400), + (medium, 500), (semibold, 600), (bold, 700), (extrabold, 800); +@each $k, $v in $weights { + .font-#{$k} { + font-weight: #{$v}; + } +} + +$texts: (xs, 0.75), (sm, 0.875), (base, 1), (lg, 1.125), (xl, 1.25), + (2xl, 1.5), (3xl, 1.875), (4xl, 2.25), (5xl, 3), (6xl, 3.75); +@each $k, $s in $texts { + .text-#{$k} { + font-size: #{$s}rem; + } +} + +.whitespace-nowrap { + white-space: nowrap; +} + +.list-disc { + list-style-type: disc; + padding-inline-start: 22px; +} + +/* interactivity */ +.cursor-pointer { + cursor: pointer; +} \ No newline at end of file diff --git a/assets/css/main.scss b/assets/css/main.scss new file mode 100644 index 0000000..ae8e840 --- /dev/null +++ b/assets/css/main.scss @@ -0,0 +1,73 @@ +@import "./pre.scss"; +@import "./theme.scss"; +@import "./atom.scss"; +@import "./md.scss"; +@import "./syntax.scss"; + + +:root { + --max-w: 1080px; + --font: -apple-system, BlinkMacSystemFont, 'MiSans Latin', MiSans, 'Segoe UI', Roboto, Oxygen, Ubuntu, + Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + +html { + font-size: 16px; + -webkit-text-size-adjust: 100%; + -ms-overflow-style: -ms-autohiding-scrollbar; + box-sizing: border-box; + border-collapse: collapse; +} + +body { + margin: 0 16px; + font-family: var(--font); + font-weight: 400; + line-height: 2.2; + background-image: var(--back-image); + background-color: var(--back); + color: var(--text); + transition-property: background-color, border-color, color; + transition-duration: 0.5s; +} + +main { + animation: showup 0.7s; +} + +main p a { + color: var(--prime); +} + +main p a:hover { + text-decoration: underline; +} + +main .search > input { + width: 100%; + padding: .5em; + font-size: large; + border: 2px solid var(--grid); + border-radius: 2px; + background-color: transparent; + outline: none; +} + +@keyframes showup { + from { + opacity: 0; + transform: translateY(20px); + } + + to { + opacity: 1; + transform: none; + } +} + +@media (min-width: 640px) { + body { + margin-top: calc(1rem + 2vh); + } +} \ No newline at end of file diff --git a/assets/css/md.scss b/assets/css/md.scss new file mode 100644 index 0000000..dc6a07b --- /dev/null +++ b/assets/css/md.scss @@ -0,0 +1,118 @@ +$heading: (h1, 2.25, 800), (h2, 2, 700), (h3, 1.75, 600), (h4, 1.5, 600), + (h5, 1.25, 500), (h6, 1, 400); +@each $tag, $size, $weight in $heading { + .md #{$tag} { + font-size: #{$size}rem; + font-weight: $weight; + margin-top: 1rem; + margin-bottom: .75rem; + } +} + +.md p { + margin: .75rem 0; +} + +.md pre { + font-size: 13px; + line-height: 1.3; +} + +.md blockquote { + background-color: #94949514; + padding: 1px .85em; + border-left: 4px solid var(--prime); + font-style: italic; +} + +.md table { + border-collapse: collapse; + border-spacing: 0; + display: block; + max-width: 100%; + width: 100%; + margin: 1em 0; + overflow: auto; +} + +.md table thead { + border-top: 2px solid var(--text); + border-bottom: 1px solid var(--text); +} + +.md table tbody { + border-bottom: 2px solid var(--text); +} + +.md table th, +.md table td { + padding: .25rem 1rem; +} + +.md img { + max-width: 100%; +} + +.md .katex { + overflow: auto hidden; +} + +.md ul { + list-style: disc; + padding-inline-start: 30px; +} + +.md ol { + list-style: decimal; + padding-inline-start: 30px; +} + +.md ul input[type="checkbox"] { + margin: 0; + margin-right: 5px; +} + +.md ul:has(input) { + list-style: none; + padding-inline-start: 8px; +} + +.md li { + margin-bottom: .5rem; + line-height: 1.5; +} + +.md ol, +.md ul, +.md img, +.md blockquote, +.md .highlight { + margin: .75rem 0; +} + +.md blockquote p { + margin: .45rem 0; + line-height: 1.5; + font-size: .95rem; +} + +.md hr { + margin: 1.5rem 0; +} + +.md .footnotes { + word-break: break-all; + font-size: .9rem; +} + +.md p sup { + margin-left: 4px; +} + +.md a { + color: var(--prime); +} + +.md a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/assets/css/pre.scss b/assets/css/pre.scss new file mode 100644 index 0000000..ea1e211 --- /dev/null +++ b/assets/css/pre.scss @@ -0,0 +1,141 @@ +/* This file is taken from https://github.com/tailwindlabs/tailwindcss/blob/master/src/css/preflight.css */ + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +5. Use the user's configured `sans` font-feature-settings by default. +*/ +html { + --default-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, + Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.5; + font-family: var(--font, --default-font); + font-feature-settings: normal; +} + + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ +body { + margin: 0; + line-height: inherit; +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ +hr { + height: 0; /* 1 */ + color: inherit; /* 2 */ + border-top-width: 1px; /* 3 */ + border-color: var(--grid, inherit); +} + +/* +Remove the default font size and weight for headings. +*/ +p, +pre, +figure, +dl, +dd, +blockquote, +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + font-size: inherit; + font-weight: inherit; +} + +.tag, +p code { + font-size: .8em; + padding: 0.1em 0.3em; + border-radius: 1px; + background-color: #9999993b; +} + + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ +a { + color: inherit; + text-decoration: inherit; +} + +a:hover { + color: var(--prime, inherit); +} + +/* +1. Use the user's configured `mono` font family by default. +2. Correct the odd `em` font sizing in all browsers. +*/ + + +kbd, +samp, +pre, +code { + --default-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: var(--font-mono, --default-font-mono); +} + + +pre { + overflow-x: auto; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ +table { + text-indent: 0; /* 1 */ + border-color: inherit; /* 2 */ + border-collapse: collapse; /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ +button, +select { + text-transform: none; +} + +::-webkit-scrollbar { + width: 4px; + height: 4px; +} + +::-webkit-scrollbar-thumb { + background: rgba(128, 128, 128, 0.7); +} +::-webkit-scrollbar-thumb:window-inactive { + background: rgba(128, 128, 128, 0.2); +} + +::-webkit-scrollbar-thumb:active { + background-color: rgb(128, 128, 128); +} diff --git a/assets/sass/syntax.scss b/assets/css/syntax.scss similarity index 50% rename from assets/sass/syntax.scss rename to assets/css/syntax.scss index 6ba5280..5d0a0ba 100644 --- a/assets/sass/syntax.scss +++ b/assets/css/syntax.scss @@ -1,15 +1,12 @@ -pre[class*="language-"], -code[class*="language-"] { - color: #d4d4d4; - font-size: 13px; - text-shadow: none; - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - line-height: 1.5; +.chroma { + margin: .5em 0; + background-image: var(--back-image); + background-color: var(--code-back); + border-radius: 2px; } -.chroma { - background-color: #292929; - margin: .5em 0; +.chroma code { + color: var(--code-text); } /* LineTableTD */ @@ -20,25 +17,33 @@ code[class*="language-"] { border: 0; } -.chroma .lntable { - border-spacing: 0; - padding: 0; - margin: 0; +.chroma .lntable tbody { border: 0; - width: auto; - overflow: auto; +} + +.chroma .lntable td:nth-child(2) { + width: 100%; +} + +.chroma .lnt, +.chroma .line { display: block; + line-height: 1.3; } /* LineNumbersTable */ .chroma .lnt { - color: #999; - display: block; - padding-left: .5em; + color: var(--code-line-number); + padding-left: .9em; padding-right: 1em; text-align: right; - line-height: 1.5; - font-size: 13px; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; +} + +.chroma .hl .lnt { + display: inline; } /* Keyword */ @@ -47,29 +52,29 @@ code[class*="language-"] { .chroma .kn, .chroma .kp, .chroma .kr, -.chroma .kt, +// .chroma .kt, .chroma .k, .chroma .si { - color: #569cd6; + color: var(--code-keyword); } .chroma .na { - color: #9cdcfe; + color: var(--code-attribute); } -.chroma .n, +// .chroma .n, .chroma .nb, .chroma .bp, -.chroma .nc, +// .chroma .nc, .chroma .no, .chroma .nd, .chroma .ni, .chroma .ne, -.chroma .nf, +// .chroma .nf, .chroma .fm, .chroma .nl, .chroma .nn { - color: #569cd6; + color: var(--code-keyword); } /* NameProperty */ @@ -80,7 +85,7 @@ code[class*="language-"] { .chroma .vg, .chroma .vi, .chroma .vm { - color: #569cd6; + color: var(--code-keyword); } /* LiteralString */ @@ -96,9 +101,11 @@ code[class*="language-"] { .chroma .sx, .chroma .sr, .chroma .s1, -.chroma .ss { - color: #ce9178; +.chroma .ss, +.chroma .cpf { + color: var(--code-literal-string); } + /* LiteralNumber */ .chroma .m, .chroma .mb, @@ -107,7 +114,7 @@ code[class*="language-"] { .chroma .mi, .chroma .il, .chroma .mo { - color: #b5cea8; + color: var(--code-literal-number); } /* Comment */ @@ -116,6 +123,25 @@ code[class*="language-"] { .chroma .cm, .chroma .c1, .chroma .cs { - color: #517043; + color: var(--code-comment); } +.chroma .nb, +.chroma .kt { + color: var(--code-builtin-type); +} + +.chroma .fm, +.chroma .nf { + color: var(--code-function); +} + + +.chroma .cp { + color: var(--code-meta); +} + +.chroma .hl { + display: block; + background-color: var(--code-highlighted-line); +} diff --git a/assets/css/theme.scss b/assets/css/theme.scss new file mode 100644 index 0000000..9cc4561 --- /dev/null +++ b/assets/css/theme.scss @@ -0,0 +1,69 @@ +:root { + // code highlighting + --code-back: #f6f8fa; + --code-text: #24292f; + --code-line-number: #999; + --code-keyword: #cf222e; + --code-attribute: #0550ae; + --code-literal-string: #0a3069; + --code-literal-number: #b5cea8; + --code-comment: #6e7781; + --code-builtin-type: #cf222e; + --code-function: #0550ae; + --code-meta: #cf222e; + --code-highlighted-line: #e9e9e9; +} + +.light { + --prime: #3170a7; + --grid: #e1e1e1; + --back: #fff; + --text: #333; +} + +.dark { + --prime: #3170a7; + --back: #181818; + --text: silver; + --grid: #555; + + // code highlighting + --code-back: #1d1d1d; + --code-text: #d4d4d4cc; + --code-line-number: #999999ca; + --code-keyword: #569cd6cb; + --code-attribute: #9cdcfecb; + --code-literal-string: #ce9178; + --code-literal-number: #b5cea8; + --code-comment: #517043d5; + --code-builtin-type: #4ec9b0cb; + --code-function: #dcdcaaca; + --code-meta: #c586c0cb; + --code-highlighted-line: #9494951b; +} + +.sand { + --prime: #3170a7; + --back: #e6dece; + --text: #434343; + --grid: #555; + + --code-back: #dbd3c1be; + --code-text: #24292f; + --code-highlighted-line: #cec3ac; + + --back-image: url('texture.png'); +} + +.rock { + --prime: #3170a7; + --back: #ccc; + --text: #434343; + --grid: #555; + + --code-back: #c1c1c1be; + --code-text: #24292f; + --code-highlighted-line: #afaeae; + + --back-image: url('texture.png'); +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index 1c8e586..347b862 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,3 +1,6 @@ -import "./theme"; -import "./style"; -import "./selectable"; \ No newline at end of file +import { setup_theme_switch } from "./theme" +import { setup_selectable } from './selectable' + + +setup_theme_switch('theme-switch') +setup_selectable() diff --git a/assets/js/min/fuse.basic.min.js b/assets/js/min/fuse.basic.min.js new file mode 100644 index 0000000..89477c6 --- /dev/null +++ b/assets/js/min/fuse.basic.min.js @@ -0,0 +1,9 @@ +/** + * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) + * + * Copyright (c) 2022 Kiro Risk (http://kiro.me) + * All Rights Reserved. Apache Software License 2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?L.getFn:n,o=t.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o;r(this,e),this.norm=S(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=n.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o,c=new O({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(k)),c.setSources(t),c.create(),c}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?L.distance:s,u=t.ignoreLocation,l=void 0===u?L.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var I=32;function F(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?L.location:o,c=i.threshold,s=void 0===c?L.threshold:c,h=i.distance,u=void 0===h?L.distance:h,l=i.includeMatches,d=void 0===l?L.includeMatches:l,f=i.findAllMatches,v=void 0===f?L.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?L.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:F(e),startIndex:t})},w=this.pattern.length;if(w>I){for(var x=0,_=w%I,S=w-_;x3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?L.location:i,a=r.distance,c=void 0===a?L.distance:a,s=r.threshold,h=void 0===s?L.threshold:s,u=r.findAllMatches,l=void 0===u?L.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?L.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,m=void 0===y?L.ignoreLocation:y;if(t.length>I)throw new Error(p(I));for(var b,k=t.length,M=e.length,w=Math.max(0,Math.min(o,M)),x=h,_=w,S=f>1||g,O=S?Array(M):[];(b=e.indexOf(t,_))>-1;){var A=j(t,{currentLocation:b,expectedLocation:w,distance:c,ignoreLocation:m});if(x=Math.min(A,x),_=b+k,S)for(var F=0;F=T;R-=1){var U=R-1,B=n[e.charAt(U)];if(S&&(O[U]=+!!B),J[R]=(J[R+1]<<1|1)&B,$&&(J[R]|=(C[R+1]|C[R])<<1|1|C[R+1]),J[R]&W&&(N=j(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=x){if(x=N,(_=U)<=w)break;T=Math.max(1,2*w-_)}}if(j(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m})>x)break;C=J}var V={isMatch:_>=0,score:Math.max(.001,N)};if(S){var q=E(O,f);q.length?g&&(V.indices=q):V.isMatch=!1}return V}(e,n,i,{location:a+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:d}),m=y.isMatch,b=y.score,k=y.indices;m&&(g=!0),v+=b,m&&k&&(f=[].concat(c(f),c(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=f),y}}]),e}(),N=[];function P(e,t){for(var n=0,r=N.length;n-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,a=void 0===o?L.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}var T=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},L),i),this.options.useExtendedSearch)throw new Error(y);this._keyStore=new b(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof O))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){f(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,c=i.shouldSort,s=i.sortFn,h=i.ignoreFieldNorm,d=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return W(d,{ignoreFieldNorm:h}),c&&d.sort(s),l(r)&&r>-1&&(d=d.slice(0,r)),K(d,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=P(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(f(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=P(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(f(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!f(n))return[];var i=[];if(h(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(f(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,u=c.score,l=c.indices;s&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return T.version="6.6.2",T.createIndex=A,T.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=t.fieldNormWeight,o=void 0===i?L.fieldNormWeight:i,a=e.keys,c=e.records,s=new O({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},T.config=L,T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file diff --git a/assets/js/search.js b/assets/js/search.js new file mode 100644 index 0000000..ba1455e --- /dev/null +++ b/assets/js/search.js @@ -0,0 +1,24 @@ +import * as params from '@params'; + +const search_input = document.querySelector("#search-input"); +const search_result = document.querySelector("#search-result"); + +let fuse; + +window.onload = async function() { + const data = await fetch("../index.json").then(res => res.json()); + const opts = params.search.fuse; + fuse = new Fuse(data, opts); +} + +search_input.addEventListener("input", function () { + if (!fuse) return; + const results = fuse.search(this.value.trim()); + let html = ''; + if (results.length > 0) { + for (const v of results) { + html += `
  • ${v.item.title}
  • `; + } + } + search_result.innerHTML = html; +}) diff --git a/assets/js/selectable.js b/assets/js/selectable.js index dc2def5..74e1dc8 100644 --- a/assets/js/selectable.js +++ b/assets/js/selectable.js @@ -1,4 +1,8 @@ -const selectable = '{{ .Site.Params.selectable }}' -if (selectable === 'false') { - document.documentElement.style = 'user-select:none' +import * as params from '@params'; + +export function setup_selectable () { + const selectable = params.selectable + if (!selectable) { + document.documentElement.style = 'user-select:none' + } } \ No newline at end of file diff --git a/assets/js/style.js b/assets/js/style.js deleted file mode 100644 index 911b2fb..0000000 --- a/assets/js/style.js +++ /dev/null @@ -1,9 +0,0 @@ -// fix style of checkboxes in posts. -document.querySelectorAll('.md ul').forEach(v => { - if (/
  • .+<\/li>/.test(v.innerHTML)) { - v.classList.add('ul-checkbox'); - } -}); - -// use custom font family -document.querySelector('body').style.setProperty('--global-font-family', '{{ .Site.Params.globalFontFamily }}'); \ No newline at end of file diff --git a/assets/js/theme.js b/assets/js/theme.js index 6a345f3..f35d309 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -1,40 +1,75 @@ -const light = '{{ index .Site.Params.switch 1 }}' -const dark = '{{ index .Site.Params.switch 0 }}' -const comment = '{{ .Site.Params.comment }}' -const LIGHT = 'light', DARK = 'dark' +import * as params from '@params'; -const themeSwitcher = document.getElementById('theme-switcher') +const comment = params.comment.provider +const default_theme_config = params.defaulttheme +const icon_light = params.switch[1] +const icon_dark = params.switch[0] +const THEME_LIGHT = default_theme_config === 'system' ? 'light' : default_theme_config +const THEME_DARK = 'dark' -// set switcher -themeSwitcher.innerHTML = localStorage.theme === LIGHT ? light : dark +/** @type {HTMLElement} */ +let toggler +/** @type {HTMLIFrameElement} */ +let utterances +/** @type {HTMLIFrameElement} */ +let giscus -themeSwitcher.addEventListener('click', function () { - const currentTheme = localStorage.theme - const newTheme = currentTheme === LIGHT ? DARK : LIGHT - - // switch global theme - switchMinimaTheme(currentTheme, newTheme) - - // switch utterance theme if necessary - - if (comment === 'utterances') - switchUtteranceTheme(`github-${newTheme}`) -}); - -function switchMinimaTheme(oldTheme, newTheme) { - const { classList } = document.documentElement - const text = newTheme === LIGHT ? light : dark; - - classList.remove(oldTheme); - classList.add(newTheme); - localStorage.theme = newTheme; - themeSwitcher.innerHTML = text; +/** @param {string} id */ +export function setup_theme_switch(id) { + if (!toggler) { + toggler = document.getElementById(id) + } + toggler.innerHTML = localStorage.theme === THEME_LIGHT ? icon_light : icon_dark + toggler.addEventListener('click', switch_theme); } -const utteranceClassName = '.utterances-frame' -let utterance; +function switch_theme() { + const current = localStorage.getItem('theme') + const next = current === THEME_LIGHT ? THEME_DARK : THEME_LIGHT -function switchUtteranceTheme(theme) { - if (!utterance) utterance = document.querySelector(utteranceClassName) - utterance.contentWindow.postMessage({type: 'set-theme', theme}, 'https://utteranc.es') -} \ No newline at end of file + switch_minima_theme(current, next) + + switch (comment) { + case 'utterances': + switch_utterances_theme(`github-${next}`) + break + case 'giscus': + switch_giscus_theme(next) + break + default: + } +} + +/** + * @param {string} current + * @param {string} next + */ +function switch_minima_theme(current, next) { + const { classList } = document.documentElement + const icon = next === THEME_LIGHT ? icon_light : icon_dark; + + classList.remove(current); + classList.add(next); + localStorage.setItem('theme', next); + toggler.innerHTML = icon; +} + +/** @param {string} theme */ +function switch_utterances_theme(theme) { + if (theme !== 'dark') { + theme = 'light' + } + utterances = utterances || document.querySelector('iframe.utterances-frame') + if (!utterances) return + utterances.contentWindow.postMessage({ type: 'set-theme', theme }, 'https://utteranc.es') +} + +/** @param {string} theme */ +function switch_giscus_theme(theme) { + if (theme !== 'dark') { + theme = 'light_protanopia' + } + giscus = giscus || document.querySelector('iframe.giscus-frame') + if (!giscus) return + giscus.contentWindow.postMessage({ giscus: { setConfig: { theme } } }, 'https://giscus.app') +} diff --git a/assets/sass/atom.scss b/assets/sass/atom.scss deleted file mode 100644 index d81c05e..0000000 --- a/assets/sass/atom.scss +++ /dev/null @@ -1,150 +0,0 @@ -* { - line-height: 1; - -webkit-tap-highlight-color: rgba(0,0,0,0); - outline: none; -} - -header nav a { - line-height: 1.8; -} - -$unit: 0.25rem; -$scales: 0, 1, 2, 3, 4, 5, 6, 7, 8, 1.5; -$screens: ( - sm\:: 640px, -); - -@mixin scale_with_prefix($prefix, $scale) { - $size: $scale * $unit; - .#{$prefix}mt-#{$scale} { - margin-top: $size; - } - .#{$prefix}mb-#{$scale} { - margin-bottom: $size; - } - .#{$prefix}ml-#{$scale} { - margin-left: $size; - } - .#{$prefix}mr-#{$scale} { - margin-right: $size; - } - .#{$prefix}my-#{$scale} { - margin-top: $size; - margin-bottom: $size; - } - .#{$prefix}mx-#{$scale} { - margin-left: $size; - margin-right: $size; - } - - .#{$prefix}pb-#{$scale} { - padding-bottom: $size; - } - .#{$prefix}py-#{$scale} { - padding-top: $size; - padding-bottom: $size; - } -} - -@each $scale in $scales { - @include scale_with_prefix("", $scale); - - @each $screen, $size in $screens { - @media (max-width: $size) { - @include scale_with_prefix($screen, $scale); - } - } -} - -@mixin style_with_prefix($prefix) { - .#{$prefix}block { - display: block; - } - .#{$prefix}flex { - display: flex; - } - .#{$prefix}flex-row { - flex-direction: row; - } - .#{$prefix}flex-col { - flex-direction: column; - } - .#{$prefix}flex-col-reverse { - flex-direction: column-reverse; - } - .#{$prefix}justify-between { - justify-content: space-between; - } - .#{$prefix}flex-nowrap { - flex-wrap: nowrap; - } - .#{$prefix}items-center { - align-items: center; - } - .#{$prefix}self-start { - align-self: flex-start; - } - .#{$prefix}hidden { - display: none; - } - .#{$prefix}text-xs { - font-size: .8rem; - } - .#{$prefix}text-sm { - font-size: .9rem; - } - .#{$prefix}text-md { - font-size: 1.25rem; - } - .#{$prefix}text-xl { - font-size: 1.5rem; - } - .#{$prefix}text-2xl { - font-size: 1.75rem; - } - .#{$prefix}text-3xl { - font-size: 2rem; - } - .#{$prefix}text-4xl { - font-size: 2.25rem; - } -} - -@include style_with_prefix(""); -@each $screen, $size in $screens { - @media (max-width: $size) { - @include style_with_prefix($screen); - } -} - -// border width -.bw-0 { - border-width: 0; -} - -// width -.min-w-32 { - min-width: 0.25 * 32rem; -} - -.whitespace-nowrap { - white-space: nowrap; -} - -.overflow-x-auto { - overflow-x: auto; -} - -.overflow-y-hidden { - overflow-y: hidden; -} - -.cursor-pointer { - cursor: pointer; -} - -.not-first\:ml-3 { - &:not(:first-child) { - margin-left: 0.75rem; - } -} \ No newline at end of file diff --git a/assets/sass/main.scss b/assets/sass/main.scss deleted file mode 100644 index ab66605..0000000 --- a/assets/sass/main.scss +++ /dev/null @@ -1,139 +0,0 @@ -@import "atom.scss"; -@import "markdown.scss"; -@import "syntax.scss"; -@import "toc.scss"; - -:root { - --pm: #0fa0ce; - --bd: #e1e1e1; - --bg: #fff; - --ft: #222; - --tag: #333; - - --w-mobile: 640px; - - --global-font-family: Verdana, Geneva, Tahoma, sans-serif; -} - -html.dark { - --bg: #181818; - --ft: silver; - --bd: #555; - --tag: #999; - - --ovo-ft: var(--ft); - --ovo-bdr: var(--bd); - --ovo-bg: var(--bg); - --ovo-bg-hvr: #555; - --ovo-tag: #30363d; -} - -body { - font-family: var(--global-font-family); - max-width: var(--w-mobile); - margin: 3rem auto 0; - font-size: 16px; - font-weight: 400; - color: var(--ft); - background-color: var(--bg); - transition-property: background-color, border-color, color; - transition-duration: 0.5s; -} - -h1, -h2, -h3, -h4, -h5 { - font-family: "Noto Serif SC", 'Times New Roman', Times, sans-serif; - font-weight: 700; - line-height: 1.5; -} - -p { - line-height: 1.8; - text-align: justify; -} - -hr { - border-width: 0; - border-top: 1px solid var(--bd); -} - -pre, -code { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - font-size: 13px; -} - -.tag, -p code { - background-color: var(--bd); - padding: 0.2em 0.4em; - border-radius: 1px; -} - -a { - text-decoration: none; - color: inherit; -} - -a:hover { - color: var(--pm); -} - -main { - animation: showup 0.7s; -} - -p a { - font-style: italic; - text-decoration: underline; -} - -footer a { - font-style: unset; - text-decoration: none; -} - -header nav { - color: var(--tag); -} - -::-webkit-scrollbar { - width: 4px; - height: 4px; -} - -::-webkit-scrollbar-thumb { - background: rgba(128, 128, 128, 0.7); -} -::-webkit-scrollbar-thumb:window-inactive { - background: rgba(128, 128, 128, 0.2); -} - -::-webkit-scrollbar-thumb:active { - background-color: rgb(128, 128, 128); -} - -h1::-webkit-scrollbar, -nav::-webkit-scrollbar { - display: none; - width: 0; -} - -@keyframes showup { - from { - opacity: 0; - transform: translateY(20px); - } - - to { - opacity: 1; - transform: none; - } -} - -.home-intro { - line-height: 1.65; -} \ No newline at end of file diff --git a/assets/sass/markdown.scss b/assets/sass/markdown.scss deleted file mode 100644 index a00e982..0000000 --- a/assets/sass/markdown.scss +++ /dev/null @@ -1,73 +0,0 @@ -.md blockquote { - background-color: rgba(148, 148, 149, 0.08) ; - padding: 1px 1rem; - border-left: 8px solid var(--pm); - font-style: italic; -} - -.md table { - border-collapse: collapse; - border-spacing: 0; - display: block; - max-width: 100%; - width: 100%; - margin: 1em 0; - overflow: auto; -} - -.md table thead { - background-color: var(--bd); -} - -.md table th, -.md table td { - padding: 10px 20px; - border-bottom: 1px solid var(--bd); -} - -.md img { - max-width: 100%; -} - -.md .katex { - overflow: auto hidden; -} - -.md ul input[type="checkbox"] { - margin-right: 3px; -} - -.md .ul-checkbox { - list-style: none; - padding-inline-start: 20px; -} - -.md li { - margin-bottom: 1rem; -} - -.md ol, -.md ul, -.md img, -.md blockquote, -.md .highlight { - margin: .75rem 0; -} - -.md hr { - margin: 1.5rem 0; -} - -.md .footnotes { - word-break: break-all; - font-size: .9rem; -} - -.md p sup { - margin-left: 4px; -} - -.md a { - font-style: italic; - text-decoration: underline; -} \ No newline at end of file diff --git a/assets/sass/toc.scss b/assets/sass/toc.scss deleted file mode 100644 index f4e2237..0000000 --- a/assets/sass/toc.scss +++ /dev/null @@ -1,89 +0,0 @@ -details.toc { - position: sticky; - top: 0; - background-color: var(--bg); - transition: .5s all; -} - -details.toc summary { - position: relative; - width: fit-content; - cursor: pointer; - background-color: var(--bg); - transition: .5s all; -} - -details.toc div { - background-color: var(--bg); - transition: .5s all; -} - -details.toc ul { - list-style-type: none; - padding-inline-start: 1em; - margin: 0; -} - -details.toc ul > li { - margin: 1em 0; -} - -details.toc-bar, -details.toc-lines { - & summary { - padding-right: 0.5em; - list-style: none; - } - & summary::-webkit-details-marker { - display: none; - } - & div { - padding-top: 1em; - } -} - -details.toc-bar { - top: 1rem; - background-color: transparent; - - & div { - top: -1em; - padding-top: 2em; - background-color: var(--bg); - } - - & summary { - --toc-bar-ht: 4px; - --toc-bar-wd: 8%; - width: var(--toc-bar-wd); - height: var(--toc-bar-ht); - margin-left: calc(50% - var(--toc-bar-wd) / 2); - border-radius: calc(var(--toc-bar-ht) / 2); - background-color: var(--ft); - box-shadow: var(--bg) 0 0 8px 8px; - } -} - -details.toc-default, -details.toc-lines { - & summary { - padding-top: 1em; - } -} - -details.toc-lines { - & summary::before { - content: "≡"; - font-size: 1.5em; - position: relative; - top: 0; - } -} - -details[open] { - &.toc-lines summary::before { - content: "×"; - font-size: 1.7em; - top: -4px; - } -} diff --git a/data/svg.toml b/data/svg.toml index 95deee7..8b34e08 100644 --- a/data/svg.toml +++ b/data/svg.toml @@ -1,5 +1,14 @@ -github = 'GitHub' -linkedin = 'LinkedIn' -twitter = 'Twitter' -rss = '' -toc = '' \ No newline at end of file +github = 'stroke-linecap="round" stroke-linejoin="round">' +email = '' +linkedin = '' +twitter = '' +facebook = '' +rss = '' +instagram = '' +mastodon = '' +keybase = ' ' +matrix = '' +neteasemusic= '' +paypal = '' +pgpkey = '' +qq = '' diff --git a/docs/README_CN.md b/docs/README_CN.md deleted file mode 100644 index 2b88e9c..0000000 --- a/docs/README_CN.md +++ /dev/null @@ -1,69 +0,0 @@ -# Minima - -Minima 是个简洁但功能完整的 Hugo 主题,是 [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima) 的 Hugo 版本,但对其界面做了些调整,也添加了些功能.。示例网页:[h.xjj.pub](https://h.xjj.pub/),或直接查看作者的博客网站:[xjj.pub](https://xjj.pub)。 - -![screenshot](../images/tn.png) - -## 功能 - -- [x] 暗黑模式,点击首页的 Logo 能在黑白两种模式下切换 -- [x] VSCode 风格的代码高亮 -- [x] KaTeX 公式 -- [x] Mermaid 图表 -- [x] Google 分析 -- [x] Disqus、Utterances 评论插件(即将支持 Waline) -- [x] 文章目录 -- [x] 分类、标签、专栏 - -## 使用 - -在使用前,确保您的设备已安装了 Hugo 最新的扩展版本(hugo-extended) - -然后确保你的博客根目录(假设为 `blog/`)处在 git 工作区,若没有,则运行下面命令 - -```bash -cd blog -git init -``` - -### 安装 - -在博客根目录使用 git submodule 将 minima 下载到博客的 theme 目录下 - -```bash -git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima -``` - -或直接使用 git 将 minima 克隆到 theme 目录下 - -```bash -git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima -``` - -总之,要将 minima 放到博客根目录的 theme 目录下。 - -### 主题配置 - -根据示例配置 [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) 编辑你自己的配置文件 `博客根目录/config.toml` - -### 文章配置 - -为缩短博客网页的加载和渲染时间,minima 不支持如公式、图表、评论插件的全局配置,需要在每篇文章中设置是否启用相关插件,以下是 minima 目前支持的文章配置。 - -| 字段 | 类型 | 解释 | -| ----------- | ------ | --------------------------------- | -| title | string | 文章标题 | -| description | string | 文章简介,会显示在标题和正文之间 | -| date | string | 文章创建日期 | -| categories | array | 文章分类 | -| series | array | 文章专栏 | -| tags | array | 文章标签 | -| math | bool | true:为该文章开启公式渲染 | -| mermaid | bool | true:为该文章开启图表渲染 | -| comment | bool | true:为该文章开启评论插件,具体是哪个插件在博客配置文件中设置 | -| draft | bool | true:该篇文章为草稿,不会被打包 | -| toc | bool | true:为该篇文章开启目录显示 | - -### 反馈 - -欢迎在 [issues](https://github.com/Mivinci/hugo-theme-minima/issues) 下留言,或将问题详细描述发送到我的邮箱:mivinci@qq.com diff --git a/exampleSite/config.toml b/exampleSite/config.toml deleted file mode 100644 index 8cf840b..0000000 --- a/exampleSite/config.toml +++ /dev/null @@ -1,132 +0,0 @@ -baseURL = "http://h.xjj.pub" -languageCode = "en-us" -title = "Hi Folks" -copyright = "© XJJ 2021" -paginate = 6 -googleAnalytics = "" - -# theme is the name of the hugo theme you choose, -# `hugo-theme-minima` is put here only for debuging, -# just name it whatever you're gonna handle the theme. -theme = "hugo-theme-minima" - -# Author has some of your information to be shown on the home -# page of your blog. -[author] -name = "XJJ" -slogon = "A student and tech lover from Earth 🌍" -description = "This is Minima, a clean and minimal Hugo theme porting from [Minima on Hexo](https://github.com/adisaktijrs/hexo-theme-minima). Except for everything from Hexo Minima like dark/light mode, it supports KaTeX and some taxonomies like categories, series and tags. I created this using SCSS, Vanilla JS and most importantly, Hugo. 😁" - - -[params] -# iam is the beginning words of your self-introduction. -iam = "I am" -# The subtitle will be shown after the title of your blog site. -# e.g. "title - subtitle". -subtitle = "" -# Comment decides the comment plugin to be used on your blog site, -# e.g. disqus, utterances, ovo. -comment = "utterances" -# Timeformat, no matter what format to use, make it the second day of Jan. 2006 -timeformat = "Jan 02, 2006" -# switch for turning on/off lights. -switch = ["🌚", "🌝"] -# If set true, date of posts will be displayed in the homepage. -displayDate = true -# If set true, users can select text from your post. -selectable = true -# Custom global font. notice: `globalFontFamily` won't be working -# on texts in some special positions like on titles -globalFontFamily = 'LXGW WenKai' -# If set true, all your posts will use the chosen comment plugin -# except those with a `comment: false` in their front-matter -commentOnAllPosts = false -# toc decides the shape of the toc button. e.g. default, lines, bar -toc = "lines" - -# Disqus configuration -[params.disqus] -shortname = "hugo-minima" - -# Utterance configuration -# Full doc's at https://utteranc.es -# **notice**: if you're going to use utterances, you must change the -# `repo` to your own repo address that stores comments on your site -[params.utterances] -repo = "mivinci/hugo-theme-minima" -issueTerm = "pathname" - -# **deprecated** -# OvO is a comment plugin written by the author of Minima. -# It is enabled when params.comment is set "ovo". You can -# find its documentation on https://github.com/ovojs/ovo. -# If you are using disqus or utterance, just ignore this field. -[params.ovo] -server = "" -placeholder = "" - - -# Params.social is an array containing your social network accounts, -# Each has a lowercase name, a svg formatted icon and a url to the -# webpage of your account. They will be shown at the bottom of every -# page of your blog. -# Be sure the svgs you use must have both its width and its height -# set 18. If you don't wanna put the svg code in this config file, -# you can instead save them to the `data/svg.toml` file under the -# root directory of your blog. e.g. `name = ''` -[[params.social]] -name = "github" -url = "https://github.com/mivinci/hugo-theme-minima" -svg = "" -[[params.social]] -name = "linkedin" -url = "https://linkedin/in/leonard-mivinci-63895317a" -svg = "" -[[params.social]] -name = "twitter" -url = "https://twitter.com/Leonard14733745" -svg = "" -[[params.social]] -name = "rss" -url = "/index.xml" -svg = "" - - -# Menu.main is an array that's used to decide what entries can be shown -# on the navigator of yur blog. You can use a weight to make them ordered. -[[menu.main]] -name = "Home" -url = "/" -weight = 1 -[[menu.main]] -name = "Categories" -url = "/categories" -weight = 2 -[[menu.main]] -name = "Series" -url = "/series" -weight = 3 -[[menu.main]] -name = "About" -url = "/about" -weight = 4 - - -# You can classify your posts by setting taxanomies in the front matter -# e.g. -# categories = ["dev"] -# series = ["Building an RPC server"] -# tags = ["hugo", "golang"] -# A little suggestion: one post belongs to one series or one category or multiple tags. -[taxonomies] -category = "categories" -tag = "tags" -series = "series" - - -# Make sure all the codes in a post are highlighted correctly -# so better not edit this. -[markup.highlight] -lineNos = true -noClasses = false - \ No newline at end of file diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml new file mode 100644 index 0000000..148ef5e --- /dev/null +++ b/exampleSite/config.yaml @@ -0,0 +1,157 @@ +baseURL: https://mivinci.github.io/hugo-theme-minima +languageCode: en-us +title: Hugo on Minima +copyright: © 2020-2023 X +googleAnalytics: +# paginate specifies the maximum number of posts displayed on the home page. +paginate: 12 +# theme specifies the name of the theme to be used. +theme: hugo-theme-minima +# defaultContentLanguage specifies the default language to use. +defaultContentLanguage: en +# language.xxx setup +languages: + en: + languageName: EN # will be displayed in the navbar. + weight: 1 + zh-cn: + languageName: 简中 # will be displayed in the navbar. + weight: 2 + author: + status: 目前住在地球 🌍 + description: | + 这是 Minima, 一个简洁的 Hugo 主题,移植自 [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima)。 + 支持深色模式、多语言、数学公式、流程图、代码语法高亮,当然还有分类、标签、系列等等。 + params: + greet: 你好 :) + +# author specifies your name, a slogon and your brief self-introduction. +author: + name: X + status: Currently living on Earth 🌍 + description: | + This is Minima, a clean and minimal Hugo theme porting from + [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). It has supports + for dark mode, multilingual mode, math formulas, flowcharts, syntax highlighting, + and of course taxonomies like categories, tags, and series. + +params: + # greet specifies greeting words. + greet: Hello :) + # subtitle speficies a subtitle displayed right after the site title. + subtitle: + # switch specifies two emojis used as the button toggling color themes. + switch: ["🌚", "🌝"] + # minima has one dark theme and multiple light themes. defaultTheme specifies + # a default light theme to use. currently available options: light, sand, rock, system. + defaultTheme: light + # displayDate speficies whether or not to display post date on the home page. + displayDate: true + # displayDescription specifies whether or not to display post description on + # the hoem page. + displayDescription: true + # selectable specifies if or not your post content can be selected. + selectable: true + # social is an array containing as many as social accounts to be displayed + # in the buttom of every page. + social: + - name: "twitter" + url: "https://twitter.com/realmivinci" + - name: "email" + url: "mailto:mivinci@qq.com" + - name: "github" + url: "https://github.com/mivinci/hugo-theme-minima" + - name: "rss" + url: "/index.xml" + + # math plugin + math: + enable: false + provider: katex + + # diagram plugin + diagram: + enable: false + provider: mermaid + + # comment plugin + comment: + enable: true + provider: giscus + # check out https://disqus.com/ + disqus: + shortname: hugo-minima + # check out https://utteranc.es + utterances: + repo: mivinci/hugo-theme-minima + issueTerm: pathname + label: comment + # check out https://giscus.app + giscus: + repo: mivinci/hugo-theme-minima + repoId: MDEwOlJlcG9zaXRvcnkzODcxMjM2NDU= + category: Comments + categoryId: DIC_kwDOFxMJvc4CScQm + mapping: pathname + inputPosition: buttom # bottom | top + reactions: true + metadata: false + + # search plugin + search: + enable: true + provider: fuse + title: Search + placeholder: Enter keywords + # check out https://fusejs.io + fuse: + keys: + - title + - permalink + - summary + - content + distance: 100 + location: 0 + threshold: 0.6 + ignoreLocation: false + isCaseSensitive: false + includeScore: false + includeMatches: false + minMatchCharLength: 1 + shouldSort: true + findAllMatches: false + + +# menu.main is an array containing what is used as the navigator. +menu: + main: + - identifier: tags + name: Tags + weight: 1 + - identifier: series + name: Series + weight: 2 + - identifier: search + name: 🔍 + weight: 3 + +# taxonomies defines ways to classify yout posts. Below are some presets that +# most bloggers use, so you can replace them with whatever you like. +taxonomies: + category: categories + tag: tags + series: series + +# outputs tells Hugo the kind of files to be rendered. +outputs: + home: + - HTML + - RSS + - JSON + +# markup.highlight has two keys set to make sure that the syntax highlighting +# in your posts are rendered correctly, so DO NOT edit them. +markup: + highlight: + lineNos: true + noClasses: false diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md index 7e1b642..04b0e4a 100644 --- a/exampleSite/content/about.md +++ b/exampleSite/content/about.md @@ -1,7 +1,83 @@ --- title: "About" -date: 2021-07-16T11:24:06+08:00 +date: 2019-07-10T11:24:06+08:00 draft: false type: about --- +A clean and minimal Hugo theme porting from [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). Check out the [example site](https://mivinci.github.io/hugo-theme-minima). + +![screenshot](./images/tn.png) + +> Note that the main branch is in development stage, UI or configuration may vary. + + +## Features + +- [x] Dark mode +- [x] Multilingual mode +- [x] Code highlighting - VSCode dark+ +- [x] Math - KaTeX +- [x] Flowcharts - Mermaid +- [x] Comment - Disqus, Utterances, Giscus +- [x] Google analytics +- [x] External link +- [x] RSS + +## Usage + +Before using Minima, make sure you've got Hugo (extended version) installed on your device. + +### Installation + +You can use either `git submodule` or `git clone` to fetch this theme into the directory where Hugo places themes. + +#### Git Submodule + +```bash +git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima +``` + +#### Git Clone + +```bash +git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima +``` + + +### Configuration + +Follow [exampleSite/config.yaml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.yaml) and edit your own one. + +## Supported Front Matters + +| Attr | Type | Explanation | +|:----------- |:------ |:------------| +| title | string | title | +| description | string | description | +| date | string | creation time | +| categories | array | category list | +| series | array | series list | +| tags | array | tag list | +| math | bool | enables math plugin | +| diagram | bool | enables diagram plugin | +| comment | bool | enable comment plugin | +| draft | bool | disallow being published | +| link | string | a URL to redirect to | + + +## Contribution + +I'm currently looking for i18n contributors :) + +## Feedback + +Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). + +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=mivinci/hugo-theme-minima&type=Date)](https://star-history.com/#star-history/star-history&Date) + +## License + +Hugo Minima is MIT licensed. diff --git a/exampleSite/content/chinese.md b/exampleSite/content/chinese.md deleted file mode 100644 index 16ba62b..0000000 --- a/exampleSite/content/chinese.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -author: XJJ -title: 中文测试 -date: 2021-07-17T10:52:59+08:00 -description: -comment: false ---- - -## 二级标题 - -这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文 - -### 三级标题 - -这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文 - -#### 四级标题 \ No newline at end of file diff --git a/exampleSite/content/instruction.md b/exampleSite/content/instruction.md deleted file mode 100644 index 95d331b..0000000 --- a/exampleSite/content/instruction.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -author: Hugo Authors -title: Instruction -date: 2021-07-19T10:52:59+08:00 -description: A Clean and minimal Hugo theme porting from Minima on Hexo. [Click me](https://h.xjj.pub/) to take a look at the demo site. -math: true -comment: true ---- - -## Features - -- [x] Light/dark mode -- [x] VSCode-style code hightlighting -- [x] KaTeX -- [x] Mermaid -- [x] Google analytics -- [x] Disqus/Utterances comments -- [x] Optional ToC - -## Usage - -Before using Minima, make sure you've got Hugo(v0.41.0 or higher) installed on your device. - -### Installation - -Suppose `blog` is where you place your sources. - -```bash -cd blog -git init -git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima -``` - -Or `clone` directly if you don't wanna use the Git submodule. - -```bash -git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima -``` - -Anyways, you just need to put Minima under the `blog/themes` directory. - -### Configuration - -Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) and edit your own `blog/config.toml` file. - -### Supported Front Matters - -| Field | Type | Explanation | -|:----------- |:------ |:------------------------------------------------------ | -| title | string | Title of the post, will be rendered in a `h1` tag | -| description | string | Description of the post, will be rendered in a `p` tag | -| date | string | Datetime that the post is written | -| categories | array | Array of categories the posts belongs to | -| series | array | Array of series the post belongs to | -| tags | array | Array of tags the posts is related to | -| math | bool | True if the post needs to render math formulas | -| mermaid | bool | True if the post needs to render mermaid graphs | -| comment | bool | True if the post allows people to make comments | -| draft | bool | True if the post isn't already to production | -| toc | bool | True if the post needs a ToC | - -### Feedback - -Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). diff --git a/exampleSite/content/link.md b/exampleSite/content/link.md new file mode 100644 index 0000000..63bba3c --- /dev/null +++ b/exampleSite/content/link.md @@ -0,0 +1,7 @@ +--- +author: Mivinci +title: An External Link +date: 2021-07-17T10:52:59+08:00 +description: This is a link to an external resource. +link: https://gohugo.io +--- \ No newline at end of file diff --git a/exampleSite/content/markdown-syntax.md b/exampleSite/content/markdown-syntax.md index 01ac69c..466fd3c 100644 --- a/exampleSite/content/markdown-syntax.md +++ b/exampleSite/content/markdown-syntax.md @@ -2,9 +2,10 @@ author: "Hugo Authors" title: "Markdown Syntax Guide" date: "2021-07-18T10:52:59+08:00" -description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." -toc: true -categories: ["Markdown"] +description: "Sample article showcasing basic Markdown syntax." +categories: +tags: + - markdown --- 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. @@ -54,21 +55,34 @@ The blockquote element represents content that is quoted from another source, op Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. | Name | Age | -| ---- | --- | - - Bob | 27 - - Alice | 23 +|:----:|:---:| +| Bob | 27 | +| Alice | 23 | #### Inline Markdown within tables | Italics | Bold | Code | -| --------- | -------- | ------ | +|:---------:|:--------:|:------:| | *italics* | **bold** | `code` | ## Code Blocks -#### Code block with backticks +#### Code block without code highlighting + +``` + + + + + Example HTML5 Document + + +

    Test

    + + +``` + +#### Code block with HTML ```html @@ -83,34 +97,60 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ``` -#### Code block indented with four spaces +#### Code block with Go - - - - - Example HTML5 Document - - -

    Test

    - - +```go {hl_lines=[3]} +type Registry interface { + Register(*Service, ...RegisterOption) error + Deregister(*Service, ...DeregisterOption) error + List(string, ...ListOption) ([]*Service, error) +} +``` -#### Code block with Hugo's internal highlight shortcode +#### Code block with C艹 -{{< highlight html >}} - +```c++ +#include - - - - Example HTML5 Document - - -

    Test

    - - -{{< /highlight >}} +class Animal { + string name; +public: + void eat(); +} + +void Animal::eat() { + std::cout << "eat something" << std::endl; +} +``` + +#### Code block with Java + +```java +class Animal { + void speak() { /* speak */ } +} + +class Dog extends Animal { + @override + void speak() { /* bark */ } +} + +class Cat extends Animal { + @override + void speak() { /* mew */ } +} +``` + +#### Code block with Python + +```python +class Dog(Animal): + def __init__(self): + super.__init__() + + def eat(): + pass +``` ## List Types diff --git a/exampleSite/content/markdown-syntax.zh-cn.md b/exampleSite/content/markdown-syntax.zh-cn.md new file mode 100644 index 0000000..e790649 --- /dev/null +++ b/exampleSite/content/markdown-syntax.zh-cn.md @@ -0,0 +1,179 @@ +--- +author: "Mivinci" +title: "Markdown 语法指北" +date: "2021-07-18T10:52:59+08:00" +description: "一篇 Markdown 示例文章,翻译自官方示例。" +categories: +tags: + - markdown +--- + +本文提供了一个可以在 Hugo 内容文件中使用的基本 Markdown 语法示例,还展示了基本 HTML 元素是否在 Hugo 主题中使用 CSS 进行修饰。 + + + +## 标题 + +下面的 HTML `

    `—`

    ` 元素代表了六个级别的章节标题。 `

    ` 是最高的部分级别,而 `

    ` 是最低的。 + +# 一级标题 + +## 二级标题 + +### 三级标题 + +#### 四级标题 + +##### 五级标题 + +###### 六级标题 + +## 段落 + +Xerum,我可以和他解释谁在痛苦中。 当我来到你身边,当我充满快乐时,我被快乐所折磨,或者他是天生的,或者是一个骗子,因为那个让我快乐痛苦的人是事情的专家,或者他撕裂和撕破自己的意志,仿佛他值得被遮盖,他是不是走到了心坎上,以同样的心去追随同样的事情? 为什么毛孔会竖起来,当它被放置在一个不知道老鼠意志或一切的地方时? 我会安静的。 就我而言,我的心以一种或另一种方式受到干扰,我把它们撕下来擦干,这样我要么杀了它们,要么让它们逃跑。 他憎恨真相,因为 veliamenim 的浪潮是起因和面子本身,而版本的痛苦又重演了。 + +是旅行吗? 因为每一件事都有一些你讨厌或讨厌的东西,所以你会吃东西,以免让你的智慧隐藏这样一个事实,即心脏和心脏或有趣的东西会从中出来。 + +## 块引用 + +blockquote 元素表示从另一个来源引用的内容,可选地带有必须在“footer”或“cite”元素内的引用,以及可选的内联更改,例如注释和缩写。 + +#### 不注明出处的块引用 + +> 然后,为了铸币安德普,要给予的知识相应地减少。 +> **注意**您可以在块引用中使用 *Markdown 语法*。 + +#### 带出处的块引用 + +> 不要通过共享内存来通信,通过通信来共享内存。
    +> — Rob Pike[^1] + +[^1]: 上述引述摘自 Rob Pike 在 2015 年 11 月 18 日 Gopherfest 期间的 [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c)。 + +## 表格 + +表格不是核心 Markdown 规范的一部分,但 Hugo 支持开箱即用地支持它们。 + +| 姓名 | 年龄 | +|:----:|:---:| +| 小明 | 27 | +| 大壮 | 23 | + +#### 表格内的内联 Markdown + +| 斜体 | 粗体 | 代码 | +|:---------:|:--------:|:------:| +| *斜体* | **粗体** | `code` | + +## 代码块 + +#### 不使用高亮的代码块 + +``` + + + + + Example HTML5 Document + + +

    Test

    + + +``` + +#### HTML 的代码块 + +```html + + + + + Example HTML5 Document + + +

    Test

    + + +``` + +#### Go 的代码块 + +```go {hl_lines=[3]} +type Registry interface { + Register(*Service, ...RegisterOption) error + Deregister(*Service, ...DeregisterOption) error + List(string, ...ListOption) ([]*Service, error) +} +``` + +#### C艹 的代码块 + +```c++ +#include + +class Animal { + string name; +public: + void eat(); +} + +void Animal::eat() { + std::cout << "eat something" << std::endl; +} +``` + +#### Jvav 的代码块 + +```java +class Animal { + void speak() { /* speak */ } +} + +class Dog extends Animal { + @override + void speak() { /* bark */ } +} + +class Cat extends Animal { + @override + void speak() { /* mew */ } +} +``` + +#### Python 的代码块 + +```python +class Dog(Animal): + def __init__(self): + super.__init__() + + def eat(): + pass +``` + +## 列表类型 + +#### 有序列表 + +1. 第一项 +2. 第二项 +3. 第三项 +- [x] 已勾选 +- [ ] 未勾选 + +#### 无序列表 + +* 第一项 +* 另一项 +* 另另一项 + +#### 嵌套列表 + +* 水果 + * 苹果 + * 橘子 + * 香蕉 +* 乳制品 + * 牛奶 + * 奶酪 diff --git a/exampleSite/content/math-typesetting.md b/exampleSite/content/math-typesetting.md index 638a82c..67440b7 100644 --- a/exampleSite/content/math-typesetting.md +++ b/exampleSite/content/math-typesetting.md @@ -1,54 +1,44 @@ --- -author: Hugo Authors +author: Mivinci title: Math Typesetting -date: 2021-07-18T10:52:59+08:00 -description: A brief guide to setup KaTeX +date: 2020-07-18T10:52:59+08:00 +description: A brief guide to write mathematical notation. math: true -categories: ["Markdown", "KaTeX"] +tags: + - KaTex + - markdown --- -Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. +Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries like [KaTeX](https://katex.org) the one that Minima uses. Here's what you can do in the configuration file to enable it. - - -In this example we will be using [KaTeX](https://katex.org/) - -- 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: - -```bash -{{ if or .Params.math .Site.Params.math }} -{{ partial "math.html" . }} -{{ end }} +``` +math: + enable: false + provider: katex ``` -- 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 +## Examples -**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) +The following are some examples of mathematical notations with KaTeX that are pretty much like LaTeX's. -{{< math.inline >}} -{{ if or .Page.Params.math .Site.Params.math }} +### Block - +``` +\varphi = 1+\frac{1}{1+\frac{1}{1+\frac{1} {1+\cdots}}} +``` - - - -{{ end }} -{{}} +wiil be rendered as: -### Examples - -{{< math.inline >}} - -

    -Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) -

    -{{}} - -Block math: $$ - \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +\varphi = 1+\frac{1}{1+\frac{1}{1+\frac{1} {1+\cdots}}} $$ + +### Inline + +``` +Pythagorean theorem can be written as $a^2+b^2=c^2$ where *a*, *b* and *c* are the length of legs of a triangle. +``` + +will be rendered as: + +Pythagorean theorem can be written as $a^2+b^2=c^2$ where *a*, *b* and *c* are the length of legs of a triangle. diff --git a/exampleSite/content/mermaid-diagrams.md b/exampleSite/content/mermaid-diagrams.md new file mode 100644 index 0000000..242a8e2 --- /dev/null +++ b/exampleSite/content/mermaid-diagrams.md @@ -0,0 +1,279 @@ +--- +author: Mermaid Team +title: Mermaid Diagrams +date: 2021-07-18T10:52:59+08:00 +description: A brief guide to write diagrams. +diagram: true +tags: + - markdown + - mermaid +--- + +## Examples + +The following are some examples of the diagrams, charts and graphs that can be made using Mermaid. Click here to jump into the [full syntax](http://mermaid-js.github.io/mermaid/). + + + +### Flowchart + +``` +flowchart LR + +A[Hard] -->|Text| B(Round) +B --> C{Decision} +C -->|One| D[Result 1] +C -->|Two| E[Result 2] +``` + +will be rendered as: + +```mermaid +flowchart LR + +A[Hard] -->|Text| B(Round) +B --> C{Decision} +C -->|One| D[Result 1] +C -->|Two| E[Result 2] +``` + +### Sequence diagram + +``` +sequenceDiagram +Alice->>John: Hello John, how are you? +loop Healthcheck + John->>John: Fight against hypochondria +end +Note right of John: Rational thoughts! +John-->>Alice: Great! +John->>Bob: How about you? +Bob-->>John: Jolly good! +``` + +will be rendered as: + +```mermaid +sequenceDiagram +Alice->>John: Hello John, how are you? +loop Healthcheck + John->>John: Fight against hypochondria +end +Note right of John: Rational thoughts! +John-->>Alice: Great! +John->>Bob: How about you? +Bob-->>John: Jolly good! +``` + +### Gantt chart + +``` +gantt + section Section + Completed :done, des1, 2014-01-06,2014-01-08 + Active :active, des2, 2014-01-07, 3d + Parallel 1 : des3, after des1, 1d + Parallel 2 : des4, after des1, 1d + Parallel 3 : des5, after des3, 1d + Parallel 4 : des6, after des4, 1d +``` + +will be rendered as: + +```mermaid +gantt + section Section + Completed :done, des1, 2014-01-06,2014-01-08 + Active :active, des2, 2014-01-07, 3d + Parallel 1 : des3, after des1, 1d + Parallel 2 : des4, after des1, 1d + Parallel 3 : des5, after des3, 1d + Parallel 4 : des6, after des4, 1d +``` + +### Class diagram + +``` +classDiagram +Class01 <|-- AveryLongClass : Cool +<> Class01 +Class09 --> C2 : Where am I? +Class09 --* C3 +Class09 --|> Class07 +Class07 : equals() +Class07 : Object[] elementData +Class01 : size() +Class01 : int chimp +Class01 : int gorilla +class Class10 { + <> + int id + size() +} +``` + +will be rendered as: + +```mermaid +classDiagram +Class01 <|-- AveryLongClass : Cool +<> Class01 +Class09 --> C2 : Where am I? +Class09 --* C3 +Class09 --|> Class07 +Class07 : equals() +Class07 : Object[] elementData +Class01 : size() +Class01 : int chimp +Class01 : int gorilla +class Class10 { + <> + int id + size() +} +``` + +### State diagram + +``` +stateDiagram-v2 +[*] --> Still +Still --> [*] +Still --> Moving +Moving --> Still +Moving --> Crash +Crash --> [*] +``` + +will be rendered as: + +```mermaid +stateDiagram-v2 +[*] --> Still +Still --> [*] +Still --> Moving +Moving --> Still +Moving --> Crash +Crash --> [*] +``` + +### Pie chart + +``` +pie +"Dogs" : 386 +"Cats" : 85.9 +"Rats" : 15 +``` + +will be rendered as: + +```mermaid +pie +"Dogs" : 386 +"Cats" : 85.9 +"Rats" : 15 +``` + + +### User Journey diagram + +``` + journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 3: Me +``` + +will be rendered as: + +```mermaid + journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 3: Me +``` + +### C4 diagram + +``` +C4Context +title System Context diagram for Internet Banking System + +Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.") +Person(customerB, "Banking Customer B") +Person_Ext(customerC, "Banking Customer C") +System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.") + +Person(customerD, "Banking Customer D", "A customer of the bank,
    with personal bank accounts.") + +Enterprise_Boundary(b1, "BankBoundary") { + + SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") + + System_Boundary(b2, "BankBoundary2") { + System(SystemA, "Banking System A") + System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts.") + } + + System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.") + SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.") + + Boundary(b3, "BankBoundary3", "boundary") { + SystemQueue(SystemF, "Banking System F Queue", "A system of the bank, with personal bank accounts.") + SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.") + } +} + +BiRel(customerA, SystemAA, "Uses") +BiRel(SystemAA, SystemE, "Uses") +Rel(SystemAA, SystemC, "Sends e-mails", "SMTP") +Rel(SystemC, customerA, "Sends e-mails to") +``` + +will be rendered as: + +```mermaid +C4Context +title System Context diagram for Internet Banking System + +Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.") +Person(customerB, "Banking Customer B") +Person_Ext(customerC, "Banking Customer C") +System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.") + +Person(customerD, "Banking Customer D", "A customer of the bank,
    with personal bank accounts.") + +Enterprise_Boundary(b1, "BankBoundary") { + + SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") + + System_Boundary(b2, "BankBoundary2") { + System(SystemA, "Banking System A") + System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts.") + } + + System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.") + SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.") + + Boundary(b3, "BankBoundary3", "boundary") { + SystemQueue(SystemF, "Banking System F Queue", "A system of the bank, with personal bank accounts.") + SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.") + } +} + +BiRel(customerA, SystemAA, "Uses") +BiRel(SystemAA, SystemE, "Uses") +Rel(SystemAA, SystemC, "Sends e-mails", "SMTP") +Rel(SystemC, customerA, "Sends e-mails to") +``` \ No newline at end of file diff --git a/exampleSite/content/mermaid-graphs.md b/exampleSite/content/mermaid-graphs.md deleted file mode 100644 index a56f499..0000000 --- a/exampleSite/content/mermaid-graphs.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -author: Hugo Authors -title: Mermaid Graphs -date: 2021-07-18T10:52:59+08:00 -description: A brief guide to setup Mermaid -mermaid: true -draft: false -categories: ["Markdown", "Mermaid"] ---- - -Here's a simple mermaid flowchart. - -{{}} -graph LR - Start --> Stop -{{}} - -For more documentations on Mermaid, view [mermaid](https://mermaid-js.github.io/mermaid). diff --git a/exampleSite/content/placeholder-text.md b/exampleSite/content/placeholder-text.md deleted file mode 100644 index 860d681..0000000 --- a/exampleSite/content/placeholder-text.md +++ /dev/null @@ -1,45 +0,0 @@ -+++ -author = "Hugo Authors" -title = "Placeholder Text" -date = "2021-07-18T10:52:59+08:00" -description = "Lorem Ipsum Dolor Si Amet" -toc = true -categories = ["Markdown"] -+++ - -Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. - -1. Exierant elisi ambit vivere dedere -2. Duce pollice -3. Eris modo -4. Spargitque ferrea quos palude - -Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. - -1. Comas hunc haec pietate fetum procerum dixit -2. Post torum vates letum Tiresia -3. Flumen querellas -4. Arcanaque montibus omnes -5. Quidem et - -# Vagus elidunt - - - -[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) - -## Mane refeci capiebant unda mulcebat - -Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. - -Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. - -Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. - -{{< css.inline >}} - - - -{{< /css.inline >}} diff --git a/exampleSite/content/search.md b/exampleSite/content/search.md new file mode 100644 index 0000000..b6d35b5 --- /dev/null +++ b/exampleSite/content/search.md @@ -0,0 +1,4 @@ +--- +title: Search +layout: search +--- \ No newline at end of file diff --git a/exampleSite/content/search.zh-cn.md b/exampleSite/content/search.zh-cn.md new file mode 100644 index 0000000..f23353f --- /dev/null +++ b/exampleSite/content/search.zh-cn.md @@ -0,0 +1,4 @@ +--- +title: 搜索 +layout: search +--- \ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..dbd1ab3 --- /dev/null +++ b/i18n/en.yaml @@ -0,0 +1,28 @@ +recent: + other: Recent Posts +older: + other: Older Posts + +home: + other: Home +about: + other: About +categories: + other: Categories +tags: + other: Tags +series: + other: Series + +timeformat: + other: Jan 02, 2006 + +paginator: + prev: + other: Newer + next: + other: Older + +post: + at: + other: Post at \ No newline at end of file diff --git a/i18n/id.yaml b/i18n/id.yaml new file mode 100644 index 0000000..761583f --- /dev/null +++ b/i18n/id.yaml @@ -0,0 +1,28 @@ +recent: + other: Postingan Terbaru +older: + other: Postingan Lama + +home: + other: Beranda +about: + other: Tentang +categories: + other: Kategori +tags: + other: Tags +series: + other: Series + +timeformat: + other: 2 Jan 2006 + +paginator: + prev: + other: Lebih Baru + next: + other: Lebih Lama + +post: + at: + other: Postingan pada diff --git a/i18n/ru.yaml b/i18n/ru.yaml new file mode 100644 index 0000000..84eb27a --- /dev/null +++ b/i18n/ru.yaml @@ -0,0 +1,28 @@ +recent: + other: Свежие посты +older: + other: Старые посты + +home: + other: Home +about: + other: Обо мне +categories: + other: Категории +tags: + other: Тэги +series: + other: Серии + +timeformat: + other: Jan 02, 2006 + +paginator: + prev: + other: Новые + next: + other: Старые + +post: + at: + other: Обуликовано diff --git a/i18n/ua.yaml b/i18n/ua.yaml new file mode 100644 index 0000000..57e4189 --- /dev/null +++ b/i18n/ua.yaml @@ -0,0 +1,28 @@ +recent: + other: Нові дописи +older: + other: Старі дописи + +home: + other: Головна +about: + other: Про мене +categories: + other: Категорії +tags: + other: Теги +series: + other: Серії + +timeformat: + other: Jan 02, 2006 + +paginator: + prev: + other: Нові + next: + other: Старі + +post: + at: + other: Опубліковано diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml new file mode 100644 index 0000000..f4a71d2 --- /dev/null +++ b/i18n/zh-cn.yaml @@ -0,0 +1,28 @@ +recent: + other: 近期文章 +older: + other: 历史文章 + +home: + other: 首页 +about: + other: 关于 +categories: + other: 分类 +tags: + other: 标签 +series: + other: 系列 + +timeformat: + other: 2006 年 01 月 02 日 + +paginator: + prev: + other: 上一页 + next: + other: 下一页 + +post: + at: + other: 发布于 \ No newline at end of file diff --git a/i18n/zh-hk.yaml b/i18n/zh-hk.yaml new file mode 100644 index 0000000..2a8493a --- /dev/null +++ b/i18n/zh-hk.yaml @@ -0,0 +1,28 @@ +recent: + other: 近期文章 +older: + other: 歷史文章 + +home: + other: 首頁 +about: + other: 關於 +categories: + other: 分類 +tags: + other: 標籤 +series: + other: 系列 + +timeformat: + other: 2006 年 01 月 02 日 + +paginator: + prev: + other: 上一頁 + next: + other: 下一頁 + +post: + at: + other: 發佈於 \ No newline at end of file diff --git a/i18n/zh-tw.yaml b/i18n/zh-tw.yaml new file mode 100644 index 0000000..2a8493a --- /dev/null +++ b/i18n/zh-tw.yaml @@ -0,0 +1,28 @@ +recent: + other: 近期文章 +older: + other: 歷史文章 + +home: + other: 首頁 +about: + other: 關於 +categories: + other: 分類 +tags: + other: 標籤 +series: + other: 系列 + +timeformat: + other: 2006 年 01 月 02 日 + +paginator: + prev: + other: 上一頁 + next: + other: 下一頁 + +post: + at: + other: 發佈於 \ No newline at end of file diff --git a/images/screenshot-dark.png b/images/screenshot-dark.png index 1b457fc..a0d4803 100644 Binary files a/images/screenshot-dark.png and b/images/screenshot-dark.png differ diff --git a/images/screenshot.png b/images/screenshot.png index 214ec4d..de71357 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index 3af6752..de71357 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/404.html b/layouts/404.html index e69de29..aff5634 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -0,0 +1,6 @@ +{{ define "main" }} +
    +

    Oops!

    +

    404 Not Found

    +
    +{{ end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index ac50352..8edd62d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,11 +1,13 @@ {{ partial "head.html" . }} - + + {{ partial "header.html" . }} - + {{ block "main" . }} {{ end }} {{ partial "footer.html" . }} + \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c4ca39c..317fe91 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,14 +1,19 @@ {{ define "main" }} -
    - {{ if isset .Data "Term" }} -

    {{ .Data.Singular | title }} - "{{ .Data.Term }}"

    - {{ else }} -

    {{ .Title }}

    - {{ end }} -
    - {{ range .Data.Pages }} - {{ partial "list.html" . }} - {{ end }} -
    +
    + {{ if isset .Data "Term" }} +

    {{ .Data.Singular | title }} - "{{ .Data.Term }}"

    + {{ else }} +

    {{ .Title }}

    + {{ end }} +
    + {{ range .Data.Pages.GroupByDate "2006" }} +

    + {{ .Key }} +

    + {{ range .Pages }} + {{ partial "item.html" . }} + {{ end }} + {{ end }} +
    -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/_default/search.html b/layouts/_default/search.html new file mode 100644 index 0000000..9217e8f --- /dev/null +++ b/layouts/_default/search.html @@ -0,0 +1,16 @@ +{{ define "main" }} +
    + {{- $title := .Site.Params.search.title | default .Title }} + {{- $placeholder := .Site.Params.search.placeholder | default .Title }} +

    {{ $title }}

    +

    Powered by fuse.js.

    + +
    +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2492e8c..1bcdfcc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,52 +1,32 @@ {{ define "main" }} -{{ if .Params.toc }} -{{ partial "toc.html" . }} -{{ end }} -

    {{ .Title }}

    -
    -
    - {{ if .Site.Params.displayDate }} - Posted at — {{ dateFormat .Site.Params.timeformat .Date }} - {{ end }} - {{ if .Draft }} - - DRAFT - - {{ end }} -
    - {{ if .Params.tags }} -
    - {{ range .Params.tags }} - #{{ . }} - {{ end }} -
    - {{ end }} +
    +

    {{ .Title }}

    +
    +
    + {{ if .Site.Params.displayDate }} + {{ T "post.at" }} — {{ .Date | time.Format (T "timeformat") }} + {{ end }} + {{ if .Draft }} + + DRAFT + + {{ end }} +
    + {{ if .Params.tags }} +
    + {{ range $tag := .Params.tags }} + {{ $url := printf "tags/%s" $tag | relLangURL }} + #{{ . }} + {{ end }} +
    + {{ end }} +
    +
    +

    {{ .Description | markdownify | safeHTML }}

    +
    + {{ .Content }} +
    +
    + {{ partial "plugin.html" . }}
    -
    -

    {{ .Description | markdownify | safeHTML }}

    -
    - {{ .Content }} -
    -
    -{{ if or .Params.math .Site.Params.math }} -{{ partial "math.html" . }} -{{ end }} - -{{ if or .Params.mermaid .Site.Params.mermaid }} -{{ partial "mermaid.html" . }} -{{ end }} - -{{ if or .Params.comment (and .Site.Params.commentOnAllPosts (ne .Params.comment false)) }} - {{ if eq .Site.Params.comment "disqus"}} - {{ partial "disqus.html" . }} - {{ end }} - - {{ if eq .Site.Params.comment "ovo"}} - {{ partial "ovo.html" . }} - {{ end }} - - {{ if eq .Site.Params.comment "utterances"}} - {{ partial "utterances.html" . }} - {{ end }} -{{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 7dff683..86f0080 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,16 +1,15 @@ {{ define "main" }} -
    -

    {{ .Title }}

    -
    {{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 4e643bb..bf01da8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,19 +1,25 @@ {{ define "main" }} -
    -

    {{ .Site.Params.iam }} {{ .Site.Author.name }}

    -

    {{ .Site.Author.slogon }}

    -

    {{ .Site.Author.description | markdownify | safeHTML }}

    - {{ if eq .Paginator.PageNumber 1 }} -

    Recent Posts

    - {{ else }} -

    Older Posts

    - {{ end }} -
    - {{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }} - {{ range $paginator.Pages }} - {{ partial "list.html" . }} - {{ end }} - {{ partial "paginator.html" . }} -
    -
    +
    +

    {{ .Site.Params.greet }}

    +

    {{ .Site.Author.status }}

    +

    {{ .Site.Author.description | markdownify | safeHTML }}

    + {{ if eq .Paginator.PageNumber 1 }} +

    {{ T "recent" }}

    + {{ else }} +

    {{ T "older" }}

    + {{ end }} +
    + {{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }} + {{ range $paginator.Pages }} + {{ if ne .Page.Layout "search" }} + {{ partial "item.html" . }} + {{ end }} + {{ end }} + {{ partial "paginator.html" . }} +
    + {{ if .Site.Params.friends.feeds }} +

    {{ .Site.Params.friends.title }}

    +
    + {{ end }} +
    {{ end }} \ No newline at end of file diff --git a/layouts/index.json b/layouts/index.json new file mode 100644 index 0000000..5847bae --- /dev/null +++ b/layouts/index.json @@ -0,0 +1,7 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range site.RegularPages -}} +{{- if ne .Layout "search" -}} + {{- $.Scratch.Add "index" (dict "title" .Title "permalink" .Permalink "summary" .Summary "content" .Plain) -}} +{{- end -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} \ No newline at end of file diff --git a/layouts/index.xml b/layouts/index.xml index 3a97292..86428e1 100644 --- a/layouts/index.xml +++ b/layouts/index.xml @@ -20,7 +20,11 @@ {{.}}{{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 }} + {{.}}{{end}}{{with .Site.Author.FollowClaim.feedId }} + + {{ .Site.FollowClaim.feedId }} + {{ .Site.FollowClaim.userId }} + {{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" -}} {{ printf "" .Permalink .MediaType | safeHTML }} diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html new file mode 100644 index 0000000..f89c001 --- /dev/null +++ b/layouts/partials/comment.html @@ -0,0 +1,84 @@ + +
    + + +{{ if eq .Site.Params.comment.provider "giscus" }} +{{ with .Site.Params.comment.giscus }} + +{{ end }} +{{ end }} + + +{{ if eq .Site.Params.comment.provider "utterances" }} +{{ with .Site.Params.comment.utterances }} + +{{ end }} +{{ end }} + + +{{ if eq .Site.Params.comment.provider "disqus" }} +{{ with .Site.Params.comment.disqus }} +
    + + +{{ end }} +{{ end }} + + +{{ if eq .Site.Params.comment.provider "artalk" }} +{{ with .Site.Params.comment.artalk }} + + + +{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/diagram.html b/layouts/partials/diagram.html new file mode 100644 index 0000000..c3bc881 --- /dev/null +++ b/layouts/partials/diagram.html @@ -0,0 +1,9 @@ +{{ if eq .Site.Params.diagram.provider "mermaid" }} + + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html deleted file mode 100644 index 7ed9284..0000000 --- a/layouts/partials/disqus.html +++ /dev/null @@ -1,16 +0,0 @@ -
    - - \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 4487d76..6038407 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,18 +1,25 @@ -