Merge pull request #1357 from nunocoracao/dev

🔖 v2.63.0
This commit is contained in:
Nuno Coração 2024-03-26 22:30:33 +00:00 committed by GitHub
commit 92c13bdc85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 290 additions and 263 deletions

View file

@ -1 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()})); !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -129,6 +129,10 @@ disableTextInHeader = false
# site = "ABC12345" # site = "ABC12345"
# domain = "llama.yoursite.com" # domain = "llama.yoursite.com"
[umamiAnalytics]
# websiteid = "ABC12345"
# domain = "llama.yoursite.com"
[buymeacoffee] [buymeacoffee]
# identifier = "" # identifier = ""
# globalWidget = true # globalWidget = true

View file

@ -5,7 +5,7 @@
theme = "blowfish" theme = "blowfish"
baseURL = "https://localhost:1313" baseURL = "https://localhost:1313"
defaultContentLanguage = "en" defaultContentLanguage = "en"
#disableLanguages = ['ja'] #to allow translation work requiring shipping to production disableLanguages = ['it'] #to allow translation work requiring shipping to production
# pluralizeListTitles = "true" # hugo function useful for non-english languages, find out more in https://gohugo.io/getting-started/configuration/#pluralizelisttitles # pluralizeListTitles = "true" # hugo function useful for non-english languages, find out more in https://gohugo.io/getting-started/configuration/#pluralizelisttitles

View file

@ -1,6 +1,6 @@
languageCode = "ja" languageCode = "ja"
languageName = "日本語" languageName = "日本語"
weight = 2 weight = 3
title = "Blowfish" title = "Blowfish"
[params] [params]

View file

@ -1,6 +1,6 @@
languageCode = "zh-cn" languageCode = "zh-cn"
languageName = "简体中文" languageName = "简体中文"
weight = 2 weight = 4
title = "Blowfish" title = "Blowfish"
[params] [params]

View file

@ -128,6 +128,10 @@ smartTOCHideUnfocusedChildren = false
# site = "ABC12345" # site = "ABC12345"
# domain = "llama.yoursite.com" # domain = "llama.yoursite.com"
[umamiAnalytics]
# websiteid = "ABC12345"
# domain = "llama.yoursite.com"
[buymeacoffee] [buymeacoffee]
identifier = "nunocoracao" identifier = "nunocoracao"
globalWidget = true globalWidget = true

View file

@ -1,21 +1,19 @@
--- ---
title: "Welcome to Blowfish! :tada:" title: "Benvenuti a Blowfish!"
description: "This page was built using the Blowfish theme for Hugo." description: "Questa pagina è stata creata utilizzando il tema Blowfish per Hugo."
--- ---
<div class="flex px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900"> <div class="flex px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
<span class="flex items-center ltr:pr-3 rtl:pl-3 text-primary-400"> <span class="flex items-center ltr:pr-3 rtl:pl-3 text-primary-400">
{{< icon "triangle-exclamation" >}} {{< icon "triangle-exclamation" >}}
</span> </span>
<span class="flex items-center justify-between grow dark:text-neutral-300"> <span class="flex items-center justify-between grow dark:text-neutral-300">
<span class="prose dark:prose-invert">This is a demo of the <code id="layout">background</code> layout.</span> <span class="prose dark:prose-invert">Questa è una demo del layout <code id="layout">background</code>.</span>
<button <pulsante
id="switch-layout-button" id="interruttore-layout-pulsante"
class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700" class="px-4 !text-neutral !no-underline round-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
> >
Switch layout &orarr; Cambia layout &orarr;
</button> </pulsante>
</span> </span>
</div> </div>
@ -24,6 +22,4 @@ description: "This page was built using the Blowfish theme for Hugo."
npx blowfish-tools npx blowfish-tools
``` ```
{{< youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" >}} {{< youtubeLite id="SgXhGb-7QbU" label="Demo degli strumenti Blowfish" >}}

View file

@ -1,5 +1,5 @@
--- ---
title: "Authors Taxonomy Listing Example" title: "Esempio di elenco di tassonomia degli autori"
---
A quick example of how to start using author taxonomies in your articles. ---
Un rapido esempio di come iniziare a utilizzare le tassonomie degli autori nei tuoi articoli.

View file

@ -2,4 +2,4 @@
title: "作者列表示例" title: "作者列表示例"
--- ---
在你的文章中添加不同作者分类的简单示例。 在你的文章中添加不同作者的简单示例。

View file

@ -1,5 +1,5 @@
--- ---
title: "Nuno Coração" title: "Nuno Coraçao"
---
Nuno's awesome dummy bio. ---
La fantastica biografia di Nuno.

View file

@ -2,4 +2,4 @@
title: "Nuno Coração" title: "Nuno Coração"
--- ---
Nuno's awesome dummy bio. 假装这里有一份 Nuno 的简介。

View file

@ -1,5 +1,5 @@
--- ---
title: "Dummy Second Author" title: "Secondo autore fittizio"
---
Dummy Second Author's awesome dummy bio. ---
La fantastica biografia fittizia di Dummy Second Author.

View file

@ -2,4 +2,4 @@
title: "Dummy Second Author" title: "Dummy Second Author"
--- ---
Dummy Second Author's awesome dummy bio. 假装这里有一份第二位作者的简介。

View file

@ -1,17 +1,15 @@
--- ---
title: "Documentation" title: "Documenti"
description: "Learn how to use Blowfish and its features." description: "Scopri come utilizzare Blowfish e le sue funzionalità."
cascade: cascade:
showDate: false showDate: false
showAuthor: false showAuthor: false
invertPagination: true invertPagination: true
---
---
{{< lead >}} {{< lead >}}
Simple, yet powerful. Learn how to use Blowfish and its features. Semplice ma potente. Scopri come utilizzare Blowfish e le sue funzionalità.
{{< /lead >}} {{< /lead >}}
This section contains everything you need to know about Blowfish. If you're new, check out the [Installation]({{< ref "docs/installation" >}}) guide to begin or visit the [Samples]({{< ref "samples" >}}) section to see what Blowfish can do. Questa sezione contiene tutto ciò che devi sapere su Blowfish. Se sei nuovo, consulta la guida [Installazione]({{< ref "docs/installation" >}}) per iniziare o visita la sezione [Esempi]({{< ref "samples" >}}) per vedere cosa può fare Blowfish.
---

View file

@ -116,8 +116,7 @@ Blowfish 定义了一种由三种主色调构成的配色方案,每种主色
#### Slate #### Slate
{{< swatches "#6B7280" "#64748b" "#6B7280" >}} {{< swatches "#6B7280" "#64748b" "#6B7280" >}}
尽管这些事默认的方案,你也可以创建属于你自己的,详细信息请参阅 [高级自定义]({{< ref "advanced-customisation#colour-schemes" >}}) 部分。 这些是内置的配色方案,你也可以去自定义这一部分,请参阅 [高级自定义]({{< ref "advanced-customisation#colour-schemes" >}}) 。
尽管这些事默认的方案,你也可以创建属于你自己的,详细信息请参阅 [高级自定义]({{< ref "advanced-customisation#colour-schemes" >}}) 部分。
## 整理内容 ## 整理内容

View file

@ -1,6 +1,6 @@
--- ---
title: "Recipes" title: "使用指南"
description: "Recipes, guides, and tutorials for Blowfish" description: "Blowfish 的使用指南和教程"
cascade: cascade:
showDate: false showDate: false
@ -9,11 +9,11 @@ cascade:
--- ---
{{< lead >}} {{< lead >}}
Recipes, guides, and tutorials for Blowfish Blowfish 的使用指南和教程
{{< /lead >}} {{< /lead >}}
**Blowfish user?** To add your guide to this list, [check the template](/guides/template/). **您是 Blowfish 的用户吗?** 要将您自己编写的指南添加到此列表,请查看[参考模板](/guides/template/)。
This section contains guides for a variety of scenarios on how to configure your theme. If you're new, check out the [Installation]({{< ref "docs/installation" >}}) guide to begin or visit the [Samples]({{< ref "samples" >}}) section to see what Blowfish can do. 本部分包含有关如何配置主题的各种指南。如果您是新用户,请查看 [安装]({{< ref "docs/installation" >}}) 指南或查看 [示例]({{< ref "samples" >}}) 部分来了解 Blowfish 能做出什么效果的网页。
--- ---

View file

@ -1,36 +1,37 @@
--- ---
title: "Recipe Template" title: "使用指南模板"
date: 1987-12-22 date: 1987-12-22
draft: false draft: false
description: "Template for creating a recipe for Blowfish theme" description: "用于创建 Blowfish 主题使用指南的模板"
tags: ["template"] tags: ["模板"]
--- ---
Thank you for wanting to contribute to Blowfish's community. 感谢您愿意为 Blowfish 社区做出贡献。
## How to start? ## 如何开始?
This is a template article that will explain how to create a new article for Blowfish's guide section. 这是一篇模板文章,将解释如何为 Blowfish 的指南部分创建新文章。
## Clone Blowfish ## Clone Blowfish 仓库
Clone this repo with the following command: 使用以下命令 clone 此仓库:
```bash ```bash
git clone https://github.com/nunocoracao/blowfish.git git clone https://github.com/nunocoracao/blowfish.git
``` ```
## Setup your files ## 配置您的文档
Copy and paste the entire folder where this `.md` file is. 复制并粘贴您要创建的 `.md` 文档所在的整个文件夹。
使用 `YYYYMM-<英文标题>` 的格式(例如:`200601-tutorial`)命名文档,不允许有空格。
Name it using the following convention `YYYYMM-title`, no white spaces are allowed. ## 编写您的指南
编写您的指南 :)
## Write your guide `img` 文件夹中储存图像并按下述格式引用它们:
Write your guide :)
Use the `img` folder to place your images and use them:
``` md
![]() ![]()
```
![Example](img/example.jpg "Image caption") ![Example](img/example.jpg "Image caption")
## Open a PR ## 提交 PR
Open a PR and thanks in advance for your contribution. 提交您的 PR Blowfish 团队在这里提前感谢您对我们这个项目的贡献。

View file

@ -1,18 +0,0 @@
---
title: "Posts"
date: 2022-06-13T20:55:37+01:00
draft: false
showDate : false
showDateUpdated : false
showHeadingAnchors : false
showPagination : false
showReadingTime : false
showTableOfContents : true
showTaxonomies : false
showWordCount : false
showSummary : false
sharingLinks : false
---

View file

@ -1,18 +0,0 @@
---
title: "投稿"
date: 2022-06-13T20:55:37+01:00
draft: false
showDate : false
showDateUpdated : false
showHeadingAnchors : false
showPagination : false
showReadingTime : false
showTableOfContents : true
showTaxonomies : false
showWordCount : false
showSummary : false
sharingLinks : false
---

View file

@ -1,18 +0,0 @@
---
title: "Posts"
date: 2022-06-13T20:55:37+01:00
draft: false
showDate : false
showDateUpdated : false
showHeadingAnchors : false
showPagination : false
showReadingTime : false
showTableOfContents : true
showTaxonomies : false
showWordCount : false
showSummary : false
sharingLinks : false
---

View file

@ -1,18 +0,0 @@
---
title: "文章"
date: 2022-06-13T20:55:37+01:00
draft: false
showDate : false
showDateUpdated : false
showHeadingAnchors : false
showPagination : false
showReadingTime : false
showTableOfContents : true
showTaxonomies : false
showWordCount : false
showSummary : false
sharingLinks : false
---

View file

@ -1,19 +1,17 @@
--- ---
title: "Samples" title: "Campioni"
description: "See what's possible with Blowfish." description: "Guarda cosa è possibile fare con Blowfish."
cascade: cascade:
showEdit: false showEdit: false
showSummary: false showSummary: false
hideFeatureImage: true hideFeatureImage: true
---
---
{{< lead >}} {{< lead >}}
Blowfish brings your content to life. :heart_eyes: Blowfish dà vita ai tuoi contenuti. :heart_eyes:
{{< /lead >}} {{< /lead >}}
This section contains some demo pages that show how Blowfish renders different types of content. You can also see an example [taxonomy listing]({{< ref "tags" >}}) page. Questa sezione contiene alcune pagine demo che mostrano come Blowfish esegue il rendering di diversi tipi di contenuto. Puoi anche vedere una pagina di esempio [elenco tassonomia]({{< ref "tags" >}}).
_**Sidenote:** This page is just a standard Blowfish article listing and Hugo has been configured to generate a `samples` content type and display article summaries._ _**Nota a margine:** Questa pagina è solo un elenco standard di articoli Blowfish e Hugo è stato configurato per generare un tipo di contenuto "campioni" e visualizzare riepiloghi degli articoli._
---

View file

@ -12,7 +12,7 @@ cascade:
Blowfish 让你的内容栩栩如生。 :heart_eyes: Blowfish 让你的内容栩栩如生。 :heart_eyes:
{{< /lead >}} {{< /lead >}}
本节包含一些示页面展示了Blowfish如何呈现不同类型的内容。你还可以看到一个[分类列表]({{< ref "tags" >}})页面的示例。 本节包含一些示页面展示了Blowfish如何呈现不同类型的内容。你还可以参考[标签]({{< ref "tags" >}})页面的示例。
_**旁注:** 这个页面只是一个标准的Blowfish文章列表并且已经配置了Hugo来生成一个 `samples` 内容类型并显示文章摘要。_ _**旁注:** 这个页面只是一个标准的Blowfish文章列表并且已经配置了Hugo来生成一个 `samples` 内容类型并显示文章摘要。_

View file

@ -1,28 +1,28 @@
--- ---
title: "Charts" title: "图表"
date: 2019-03-06 date: 2019-03-06
description: "Guide to Chart.js usage in Blowfish" description: "在Blowfish 中使用 Chart.js 指南"
summary: "Blowfish includes Chart.js for powerful charts and data visualisations." summary: "Blowfish 包含 Chart.js可实现强大的图表和数据可视化。"
tags: ["chart", "sample", "graph", "shortcodes"] tags: ["表格", "示例", "图片", "简码"]
showDate: false showDate: false
type: 'sample' type: 'sample'
--- ---
Blowfish includes support for Chart.js using the `chart` shortcode. Simply wrap the chart markup within the shortcode. Blowfish automatically themes charts to match the configured `colorScheme` parameter, however the colours can be customised using normal Chart.js syntax. Blowfish 使用 `chart` 简码来调用 Chart.js。Blowfish 会自动为图表设置主题以匹配配置的 `colorScheme` 参数,但是可以使用 Chart.js 语法来自定义图表颜色。
Refer to the [chart shortcode]({{< ref "docs/shortcodes#chart" >}}) docs for more details. 有关更多详细信息,请参阅 [图表简码]({{< ref "docs/shortcodes#chart" >}}) 文档。
The examples below are a small selection taken from the [official Chart.js docs](https://www.chartjs.org/docs/latest/samples). You can also [view the page source](https://raw.githubusercontent.com/nunocoracao/blowfish/main/exampleSite/content/samples/charts/index.md) on GitHub to see the markup. 下面的示例是从 [Chart.js 官方文档](https://www.chartjs.org/docs/latest/samples) 中选取的一小部分。您还可以在 GitHub 上[查看页面源代码](https://raw.githubusercontent.com/nunocoracao/blowfish/main/exampleSite/content/samples/charts/index.md) 查看书写方式。
## Bar chart ## 柱形图
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
{{< chart >}} {{< chart >}}
type: 'bar', type: 'bar',
data: { data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], labels: ['一月', '二月', '三月', '四月', '五月', '六月', '七月'],
datasets: [{ datasets: [{
label: 'My First Dataset', label: '我的第一组数据',
data: [65, 59, 80, 81, 56, 55, 40], data: [65, 59, 80, 81, 56, 55, 40],
backgroundColor: [ backgroundColor: [
'rgba(255, 99, 132, 0.2)', 'rgba(255, 99, 132, 0.2)',
@ -48,15 +48,15 @@ data: {
{{< /chart >}} {{< /chart >}}
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
## Line chart ## 折线图
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
{{< chart >}} {{< chart >}}
type: 'line', type: 'line',
data: { data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], labels: ['一月', '二月', '三月', '四月', '五月', '六月', '七月'],
datasets: [{ datasets: [{
label: 'My First Dataset', label: '我的第一组数据',
data: [65, 59, 80, 81, 56, 55, 40], data: [65, 59, 80, 81, 56, 55, 40],
tension: 0.2 tension: 0.2
}] }]
@ -64,15 +64,15 @@ data: {
{{< /chart >}} {{< /chart >}}
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
## Doughnut chart ## 扇形图
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
{{< chart >}} {{< chart >}}
type: 'doughnut', type: 'doughnut',
data: { data: {
labels: ['Red', 'Blue', 'Yellow'], labels: ['红', '蓝', '黄'],
datasets: [{ datasets: [{
label: 'My First Dataset', label: '我的第一组数据',
data: [300, 50, 100], data: [300, 50, 100],
backgroundColor: [ backgroundColor: [
'rgba(255, 99, 132, 0.7)', 'rgba(255, 99, 132, 0.7)',

View file

@ -1,19 +1,19 @@
--- ---
title: "Diagrams and Flowcharts" title: "流程图和思维导图"
date: 2019-03-06 date: 2019-03-06
description: "Guide to Mermaid usage in Blowfish" description: "Blowfish 中 Mermaid 的使用指南"
summary: "It's easy to add diagrams and flowcharts to articles using Mermaid." summary: "使用 Mermaid 可以轻松地将图表和流程图添加到文章中。"
tags: ["mermaid", "sample", "diagram", "shortcodes"] tags: ["mermaid", "示例", "流程图", "简码"]
type: 'sample' type: 'sample'
--- ---
Mermaid diagrams are supported in Blowfish using the `mermaid` shortcode. Simply wrap the diagram markup within the shortcode. Blowfish automatically themes Mermaid diagrams to match the configured `colorScheme` parameter. Blowfish 使用 `mermaid` 简码可以调用。Blowfish 会根据配置的 `colorScheme` 参数自动调用 Mermaid 生成流程图或者思维导图。
Refer to the [mermaid shortcode]({{< ref "docs/shortcodes#mermaid" >}}) docs for more details. 有关更多详细信息,请参阅 [Mermaid 简码]({{< ref "docs/shortcodes#mermaid" >}}) 文档。
The examples below are a small selection taken from the [official Mermaid docs](https://mermaid-js.github.io/mermaid/). You can also [view the page source](https://raw.githubusercontent.com/nunocoracao/blowfish/main/exampleSite/content/samples/diagrams-flowcharts/index.md) on GitHub to see the markup. 下面的示例是从[官方 Mermaid 文档](https://mermaid-js.github.io/mermaid/) 中选取的一小部分。您还可以在 GitHub 上[查看页面源代码](https://raw.githubusercontent.com/nunocoracao/blowfish/main/exampleSite/content/samples/diagrams-flowcharts/index.md) 查看书写方法。
## Flowchart ## 流程图
<div style="background-color:white; padding: 20px"> <div style="background-color:white; padding: 20px">
{{< mermaid >}} {{< mermaid >}}
@ -34,7 +34,7 @@ end
{{< /mermaid >}} {{< /mermaid >}}
</div> </div>
## Sequence diagram ## 时序图
<div style="background-color:white; padding: 20px"> <div style="background-color:white; padding: 20px">
{{< mermaid >}} {{< mermaid >}}
@ -56,7 +56,7 @@ end
{{< /mermaid >}} {{< /mermaid >}}
</div> </div>
## Class diagram ## 类图
<div style="background-color:white; padding: 20px"> <div style="background-color:white; padding: 20px">
{{< mermaid >}} {{< mermaid >}}
@ -84,7 +84,7 @@ class Zebra{
{{< /mermaid >}} {{< /mermaid >}}
</div> </div>
## Entity relationship diagram ## 实体关系图
<div style="background-color:white; padding: 20px"> <div style="background-color:white; padding: 20px">
{{< mermaid >}} {{< mermaid >}}

View file

@ -1,20 +1,20 @@
--- ---
title: "Emoji :parachute:" title: "Emoji 表情符号 :parachute:"
date: 2019-03-05 date: 2019-03-05
description: "Guide to Emoji usage in Blowfish" description: "Blowfish 中的表情符号使用指南"
summary: "📖🏞️🧗🏽🐉🧙🏽‍♂️🧚🏽👸" summary: "📖🏞️🧗🏽🐉🧙🏽‍♂️🧚🏽👸"
tags: ["emoji", "sample"] tags: ["emoji", "示例"]
type: 'sample' type: 'sample'
--- ---
Emoji is supported throughout Blowfish by default. Emoji can be used in titles, menu items and article content. Blowfish 支持 Emoji 表情符号。Emoji 表情符号可用于标题、菜单项和文章内容。
{{< alert >}} {{< alert >}}
**Note:** The rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack. **注意:** Emoji 的显示效果取决于您的浏览器和操作系统。要设置统一的表情符号样式,您可以使用第三方 Emoji 表情符号字体。
{{< /alert >}} {{< /alert >}}
Emoji replacements are automatic throughout Blowfish, so you can use shorthand codes in your content and front matter and they will be converted to their corresponding symbols at build time. Blowfish 会自动的进行表情符号渲染,因此您可以在内容和 frontmatter 中使用 Emoji 表情代码,它们将在构建时转换为相应的 Emoji。
**Example:** `see_no_evil` :see_no_evil:, `hear_no_evil` :hear_no_evil:, `speak_no_evil` :speak_no_evil:. **例如:** `see_no_evil` :see_no_evil:, `hear_no_evil` :hear_no_evil:, `speak_no_evil` :speak_no_evil:.
The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. [Emoji 清单](http://www.emoji-cheat-sheet.com/) 可以很方便的查找 Emoji 对应的表情代码。

View file

@ -1,8 +1,8 @@
--- ---
title: "An External Article" title: "外部文章"
date: 2019-01-24 date: 2019-01-24
externalUrl: "https://nunocoracao.com/projects/" externalUrl: "https://nunocoracao.com/projects/"
summary: "The `externalUrl` front matter parameter can link to any URL." summary: "`externalUrl` front matter 参数可以链接到任何外部 URL."
showReadingTime: true showReadingTime: true
_build: _build:
render: "false" render: "false"
@ -10,6 +10,6 @@ _build:
type: 'sample' type: 'sample'
--- ---
This page uses the `externalUrl` front matter parameter to link to an article outside of this Hugo website. 此页面使用 `externalUrl` front matter 参数链接到 Hugo 网站之外的文章。
It's great for things like linking to posts on Medium or to research papers you may have hosted on third party websites. 它非常适合链接到 Medium 上的帖子或在第三方网站上托管的文章。

View file

@ -5,7 +5,7 @@ lastmod: 2022-03-09
draft: false draft: false
description: "Blowfish 支持的图标。" description: "Blowfish 支持的图标。"
slug: "icons" slug: "icons"
tags: ["图标", "示例", "短代码"] tags: ["图标", "示例", "码"]
type: 'sample' type: 'sample'
--- ---

View file

@ -1,18 +1,18 @@
--- ---
title: "Markdown" title: "Markdown"
date: 2019-03-11 date: 2019-03-11
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." description: "在 Markdown 文章中添加 HTML 元素的基本语法和格式。"
tags: ["markdown", "css", "html", "sample"] tags: ["markdown", "css", "html", "示例"]
type: 'sample' type: 'sample'
--- ---
This article offers a sample of basic Markdown formatting that can be used in Blowfish, also it shows how some basic HTML elements are decorated. 本文提供了可在 Blowfish 中使用的基本 Markdown 格式示例,还展示了如何加入一些基本 HTML 元素。
<!--more--> <!--more-->
## Headings ## 标题
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest. 以下 HTML 元素 `<h1>`—`<h6>` 表示六个级别的标题。 `<h1>` 是最高的标题级别,而 `<h6>` 是最低的。
# H1 # H1
@ -26,46 +26,46 @@ The following HTML `<h1>`—`<h6>` elements represent six levels of section head
###### H6 ###### H6
## Paragraph ## 段落
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, 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. Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
## Blockquotes ## 块引用
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. 块引用表示从其他来源引用的内容,可以用于位于 `footer``cite` 元素内的引文,并且可以表示一些补充说明(例如注释和缩写)。
### Blockquote without attribution ### 没有参考链接的块引用
> Tiam, ad mint andaepu dandae nostion secatur sequo quae. > Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use _Markdown syntax_ within a blockquote. > **Note** that you can use _Markdown syntax_ within a blockquote.
### Blockquote with attribution ### 有参考链接的块引用
> Don't communicate by sharing memory, share memory by communicating.<br> > Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite> > — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk `about` nothing](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. [^1]: 上述引文摘自 Rob Pike 在 2015 年 11 月 18 日 Gopherfest 期间的[谈论“什么都没有”](https://www.youtube.com/watch?v=PAAkCSZUG1c)。
## Tables ## 表格
Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. 表格不是核心 Markdown 规范的一部分,但 Hugo 支持渲染。
| Name | Age | | Name | Age |
| ----- | --- | | ----- | --- |
| Bob | 27 | | Bob | 27 |
| Alice | 23 | | Alice | 23 |
### Inline Markdown within tables ### 表格内内联 Markdown
| Italics | Bold | Code | | Italics | Bold | Code |
| --------- | -------- | ------ | | --------- | -------- | ------ |
| _italics_ | **bold** | `code` | | _italics_ | **bold** | `code` |
## Code Blocks ## 代码块
### Code block with backticks ### 带反引号的代码块
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
@ -80,7 +80,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html> </html>
``` ```
### Code block indented with four spaces ### 缩进四个空格的代码块
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -93,7 +93,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</body> </body>
</html> </html>
### Code block with Hugo's internal highlight shortcode ### 带有 Hugo 内部高亮简码的代码块
{{< highlight html "linenos=table,hl_lines=4 7-9" >}} {{< highlight html "linenos=table,hl_lines=4 7-9" >}}
@ -109,21 +109,21 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html> </html>
{{< /highlight >}} {{< /highlight >}}
## List Types ## 列表
### Ordered List ### 有序列表
1. First item 1. First item
2. Second item 2. Second item
3. Third item 3. Third item
### Unordered List ### 无序列表
- List item - List item
- Another item - Another item
- And another item - And another item
### Nested list ### 嵌套列表
- Fruit - Fruit
- Apple - Apple
@ -133,7 +133,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
- Milk - Milk
- Cheese - Cheese
## Other Elements — abbr, sub, sup, kbd, mark ## 其他元素 — abbr、sub、sup、kbd、mark
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format. <abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.

View file

@ -1,29 +1,29 @@
--- ---
title: Mathematical notation title: 数学表达式
date: 2019-03-08 date: 2019-03-08
description: A brief sample of mathematical notation in Blowfish. description: Blowfish 中数学表达式的简短示例。
tags: ["sample", "katex", "maths", "shortcodes"] tags: ["示例", "katex", "数学", "简码"]
type: 'sample' type: 'sample'
--- ---
KaTeX can be used to render mathematical notation within articles. KaTeX 可用于在文章中呈现数学表达式。
<!--more--> <!--more-->
{{< katex >}} {{< katex >}}
Blowfish will only bundle the KaTeX assets into your project if you make use of mathematical notation. In order for this to work, simply include the [`katex` shortcode]({{< ref "docs/shortcodes#katex" >}}) within the article. Example below: 如果您想要使用数学符号Blowfish 会将 KaTeX 自动加入到您的项目中。只需在文章中包含 [`katex` 短代码]({{< ref "docs/shortcodes#katex" >}}) 即可。参考下面的例子:
```md ```md
{{</* katex */>}} {{</* katex */>}}
``` ```
Any KaTeX syntax on that page will then be automatically rendered. Use the online reference of [supported TeX functions](https://katex.org/docs/supported.html) for the available syntax. 该页面上的任何 KaTeX 语法都会自动渲染。使用[支持的 TeX 函数](https://katex.org/docs/supported.html) 的在线参考来获取可用语法。
## Inline notation ## 内联表示法
Inline notation can be generated by wrapping the expression in `\\(` and `\\)` delimiters. 可以通过将表达式包装在 `\\(``\\)` 分隔符中来生成内联表示法。
**Example:** **例如:**
```tex ```tex
% KaTeX inline notation % KaTeX inline notation
@ -32,11 +32,11 @@ Inline notation: \\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\\)
Inline notation: \\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\\) Inline notation: \\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\\)
## Block notation ## 表达式块
Alternatively, block notation can be generated using `$$` delimiters. This will output the expression in its own HTML block. 可以使用 `$$` 分隔符生成表达式块。这将在其 HTML 块中输出表达式。
**Example:** **例如:**
```tex ```tex
% KaTeX block notation % KaTeX block notation

View file

@ -1,10 +1,10 @@
--- ---
title: "Multiple Authors" title: "多作者"
date: 2022-10-12 date: 2022-10-12
draft: false draft: false
description: "Sample for a multiple author setup" description: "多作者设置示例"
tags: ["authors", "sample"] tags: ["作者", "示例"]
summary: "A quick example of how multiple authors could be used." summary: "如何使用多个作者的简单示例。"
showAuthor: false showAuthor: false
authors: authors:
- "nunocoracao" - "nunocoracao"
@ -12,4 +12,4 @@ authors:
type: 'sample' type: 'sample'
--- ---
This is an example of how an article with multiple authors will look like. 这是具有多个作者的文章的示例。

View file

@ -1,10 +1,10 @@
--- ---
title: "Placeholder Text" title: "文本占位符"
date: "2019-03-09" date: "2019-03-09"
lastmod: "2022-01-24" lastmod: "2022-01-24"
draft: false draft: false
description: "Lorem Ipsum Dolor Si Amet" description: "Lorem Ipsum Dolor Si Amet"
tags: ["markdown", "text", "sample", "latin"] tags: ["markdown", "文本", "示例", "拉丁语"]
showDateUpdated: true showDateUpdated: true
xml: false xml: false
type: 'sample' type: 'sample'

View file

@ -1,36 +1,36 @@
--- ---
title: "Rich Content" title: "简码示例"
date: 2019-03-10 date: 2019-03-10
description: "A brief description of Hugo Shortcodes" description: "Hugo 简码的简要说明"
summary: "This is an _example_ of a **rich** content summary." summary: "这是**简码**内容的示例。"
tags: ["shortcodes", "privacy", "sample", "gist", "twitter", "youtube", "vimeo"] tags: ["简码", "隐私", "示例", "gist", "twitter", "youtube", "vimeo"]
type: 'sample' type: 'sample'
--- ---
Hugo ships with several [built-in shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [privacy config](https://gohugo.io/about/hugo-and-gdpr/) and a set of _simple shortcodes_ that enable static and no-JS versions of various social media embeds. Hugo 附带了几个用于丰富内容的[内置简码](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes),以及一个[隐私配置](https: //gohugo.io/about/hugo-and-gdpr/) 和一组干练的简码,支持各种社交媒体嵌入的静态窗口。
## YouTube ## YouTube
Below is an example using the built-in `youtube` shortcode. 下面是一个使用内置 `youtube` 简码的示例。
{{< youtube ZJthWmvUzzc >}} {{< youtube ZJthWmvUzzc >}}
## Twitter ## Twitter
This example uses the `twitter_simple` shortcode to output a Tweet. It requires two named parameters `user` and `id`. 此示例使用 `twitter_simple` 简码来显示推文。它需要两个参数 `user``id`
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}} {{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}
Alternatively, the `tweet` shortcode can be used to embed a fully marked up Twitter card. 或者,`tweet` 简码可用于生成嵌入式的 Twitter 卡片。
## Gist ## Gist
The `gist` shortcode can be used to embed a GitHub Gist. It requires two unnamed parameters: the username and ID of the Gist. `gist` 简码可用于嵌入 GitHub Gist。它需要两个参数Gist 的用户名和 ID。
{{< gist nunocoracao 2779792841f7ffa7c7e62dc4d38626d4 >}} {{< gist nunocoracao 2779792841f7ffa7c7e62dc4d38626d4 >}}
## Vimeo ## Vimeo
The `vimeo_simple` shortcode will embed a Vimeo video. `vimeo_simple` 简码将生成一个嵌入式的 Vimeo 播放器。
{{< vimeo_simple 48912912 >}} {{< vimeo_simple 48912912 >}}

View file

@ -1,9 +1,9 @@
--- ---
title: Tags title: Tag
---
---
Blowfish has full support for Hugo taxonomies and will adapt to any taxonomy set up. Taxonomy listings like this one also support custom content to be displayed above the list of terms. Blowfish ha il pieno supporto per le tassonomie Hugo e si adatterà a qualsiasi impostazione tassonomica. Gli elenchi di tassonomia come questo supportano anche il contenuto personalizzato da visualizzare sopra l'elenco dei termini.
This area could be used to add some extra descriptive text to each taxonomy. Check out the [advanced tag]({{< ref "advanced" >}}) below to see how to take this concept even further. Quest'area può essere utilizzata per aggiungere testo descrittivo aggiuntivo a ciascuna tassonomia. Dai un'occhiata al [tag avanzato]({{< ref "advanced" >}}) di seguito per vedere come portare questo concetto ancora oltre.
--- ---

View file

@ -0,0 +1,75 @@
const fs = require('fs');
const configDir = "./exampleSite/config/_default";
const contentDir = "./exampleSite/content";
const defaultLang = "en";
var targetLangs = []
function readConfigs() {
const files = fs.readdirSync(configDir);
files.forEach(file => {
//console.log(file)
if(file.indexOf("languages.") > -1) {
var lang = file.split(".")[1];
//console.log(lang)
if(lang != defaultLang) {
targetLangs.push(lang);
}
}
});
}
async function processFile(filePath, file) {
if (filePath.indexOf("index.md") > -1) {
//console.log("processing", filePath)
for(var i in targetLangs) {
const targetLang = targetLangs[i];
var targetFilePath = filePath.replace(".md", "." + targetLang + ".md");
//var targetFileName = file.replace(".md", "." + targetLang + ".md");
if(fs.existsSync(targetFilePath)) {
//console.log("file already exists", targetFilePath);
const data = fs.readFileSync(filePath, 'utf8');
const data2 = fs.readFileSync(targetFilePath, 'utf8');
if(data != data2) {
//console.log("file contents are different", targetFilePath);
}else{
//console.log("file contents are the same", targetFilePath);
console.log(targetFilePath);
//process.exit(1);
}
}else{
//console.log("file does not exist", targetFilePath);
}
}
} else
return
}
async function processFolder(folderPath) {
const files = fs.readdirSync(folderPath);
for (var i in files) {
const file = files[i];
const filePath = `${folderPath}/${file}`;
const isDir = fs.lstatSync(filePath).isDirectory();
if (isDir) {
await processFolder(filePath);
} else {
await processFile(filePath, file);
}
}
}
async function createLinks() {
processFolder(contentDir);
}
readConfigs();
createLinks();

View file

@ -1,5 +1,5 @@
global: global:
language: "ZH-CN" language: "简体中文"
article: article:
anchor_label: "锚点" anchor_label: "锚点"

View file

@ -1,5 +1,5 @@
global: global:
language: "ZH-TW" language: "繁體中文"
article: article:
anchor_label: "定位點" anchor_label: "定位點"

View file

@ -19,9 +19,10 @@
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden"> <div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }} {{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
</div> </div>
{{ $translations := .AllTranslations }}
{{ $path := .File.Path }} {{ with .File }}
{{range .AllTranslations}} {{ $path := .Path }}
{{range $translations}}
{{ $lang := print "." .Lang ".md" }} {{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }} {{ $path = replace $path $lang ".md" }}
{{end}} {{end}}
@ -29,6 +30,7 @@
var oid = "views_{{ $path }}" var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}" var oid_likes = "likes_{{ $path }}"
</script> </script>
{{ end }}
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script> <script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>

View file

@ -86,8 +86,10 @@
{{ partial "related.html" . }} {{ partial "related.html" . }}
</div> </div>
{{ $path := .File.Path }} {{ $translations := .AllTranslations }}
{{range .AllTranslations}} {{ with .File }}
{{ $path := .Path }}
{{range $translations}}
{{ $lang := print "." .Lang ".md" }} {{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }} {{ $path = replace $path $lang ".md" }}
{{end}} {{end}}
@ -95,6 +97,7 @@
var oid = "views_{{ $path }}" var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}" var oid_likes = "likes_{{ $path }}"
</script> </script>
{{ end }}
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script> <script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>

View file

@ -4,3 +4,6 @@
{{ with site.Config.Services.GoogleAnalytics.ID }} {{ with site.Config.Services.GoogleAnalytics.ID }}
{{ partial "analytics/ga.html" }} {{ partial "analytics/ga.html" }}
{{ end }} {{ end }}
{{ with site.Params.umamiAnalytics.websiteid }}
{{ partial "analytics/umami.html" }}
{{ end }}

View file

@ -0,0 +1,16 @@
{{ if isset site.Params.umamiAnalytics "domain" }}
<script data-id="umami-script" async src="https://{{ site.Params.umamiAnalytics.domain }}/script.js" data-website-id="{{ site.Params.umamiAnalytics.websiteid }}">
</script>
{{ else }}
<script data-id="umami-script" async src="https://analytics.umami.is/script.js" data-website-id="{{ site.Params.umamiAnalytics.websiteid }}">
</script>
{{ end }}
<script type="text/javascript">
document.querySelector('script[data-id="umami-script"]').addEventListener('load', function () {
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
umami.track(type + ':' +title, {'url': url});
});
</script>

12
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "hugo-blowfish-theme", "name": "hugo-blowfish-theme",
"version": "2.62.0", "version": "2.63.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hugo-blowfish-theme", "name": "hugo-blowfish-theme",
"version": "2.62.0", "version": "2.63.0",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@ -21,7 +21,7 @@
"chart.js": "^4.4.2", "chart.js": "^4.4.2",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"katex": "^0.16.9", "katex": "^0.16.10",
"lite-youtube-embed": "^0.3.2", "lite-youtube-embed": "^0.3.2",
"mermaid": "^10.9.0", "mermaid": "^10.9.0",
"packery": "^2.1.2", "packery": "^2.1.2",
@ -2164,9 +2164,9 @@
} }
}, },
"node_modules/katex": { "node_modules/katex": {
"version": "0.16.9", "version": "0.16.10",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.9.tgz", "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz",
"integrity": "sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==", "integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==",
"dev": true, "dev": true,
"funding": [ "funding": [
"https://opencollective.com/katex", "https://opencollective.com/katex",

View file

@ -1,6 +1,6 @@
{ {
"name": "hugo-blowfish-theme", "name": "hugo-blowfish-theme",
"version": "2.62.0", "version": "2.63.0",
"description": "Blowfish theme for Hugo", "description": "Blowfish theme for Hugo",
"scripts": { "scripts": {
"postinstall": "vendor-copy", "postinstall": "vendor-copy",
@ -38,7 +38,7 @@
"chart.js": "^4.4.2", "chart.js": "^4.4.2",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"katex": "^0.16.9", "katex": "^0.16.10",
"lite-youtube-embed": "^0.3.2", "lite-youtube-embed": "^0.3.2",
"mermaid": "^10.9.0", "mermaid": "^10.9.0",
"packery": "^2.1.2", "packery": "^2.1.2",