Skip to content

Commit

Permalink
Merge pull request #1518 from nunocoracao/dev
Browse files Browse the repository at this point in the history
🔖 v2.71.0
  • Loading branch information
nunocoracao authored Jun 19, 2024
2 parents 0a91156 + ed1efd2 commit efba32b
Show file tree
Hide file tree
Showing 166 changed files with 637 additions and 403 deletions.
377 changes: 270 additions & 107 deletions assets/css/compiled/main.css

Large diffs are not rendered by default.

86 changes: 44 additions & 42 deletions assets/js/zen-mode.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
function _toogleZenMode(zendModeButton) {
// Nodes selection
const body = document.querySelector('body');
const tocRight = document.querySelector('.toc-right');
const tocInside = document.querySelector('.toc-inside');
const articleContent = document.querySelector('.article-content');
const header = document.querySelector('#single_header');
// Nodes selection
const body = document.querySelector('body');
const tocRight = document.querySelector('.toc-right');
const tocInside = document.querySelector('.toc-inside');
const articleContent = document.querySelector('.article-content');
const header = document.querySelector('#single_header');


// Add semantic class into body tag
body.classList.toggle('zen-mode-enable');
// Add semantic class into body tag
body.classList.toggle('zen-mode-enable');

// Show/Hide 'toc right' and 'toc inside'
// Show/Hide 'toc right' and 'toc inside'
if (tocRight)
tocRight.classList.toggle('lg:block');
if (tocInside)
tocInside.classList.toggle('lg:hidden');

// Change width of article content
articleContent.classList.toggle('max-w-fit');
articleContent.classList.toggle('max-w-prose');

// Read i18n title from data-attributes
const titleI18nDisable = zendModeButton.getAttribute('data-title-i18n-disable');
const titleI18nEnable = zendModeButton.getAttribute('data-title-i18n-enable');

if (body.classList.contains('zen-mode-enable')) {
// Persist configuration
//localStorage.setItem('blowfish-zen-mode-enabled', 'true');
// Change title to enable
zendModeButton.setAttribute('title', titleI18nEnable)
// Auto-scroll to title article
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90);
} else {
//localStorage.setItem('blowfish-zen-mode-enabled', 'false');
zendModeButton.setAttribute('title', titleI18nDisable);
document.querySelector('body').scrollIntoView();
}
// Change width of article content
articleContent.classList.toggle('max-w-fit');
articleContent.classList.toggle('max-w-prose');

// Read i18n title from data-attributes
const titleI18nDisable = zendModeButton.getAttribute('data-title-i18n-disable');
const titleI18nEnable = zendModeButton.getAttribute('data-title-i18n-enable');

if (body.classList.contains('zen-mode-enable')) {
// Persist configuration
//localStorage.setItem('blowfish-zen-mode-enabled', 'true');

// Change title to enable
zendModeButton.setAttribute('title', titleI18nEnable)
// Auto-scroll to title article
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90);
} else {
//localStorage.setItem('blowfish-zen-mode-enabled', 'false');
zendModeButton.setAttribute('title', titleI18nDisable);
document.querySelector('body').scrollIntoView();
}
}

function _registerZendModeButtonClick(zendModeButton) {
zendModeButton.addEventListener('click', function (event) {
event.preventDefault();
zendModeButton.addEventListener('click', function (event) {
event.preventDefault();

// Toggle zen-mode
_toogleZenMode(zendModeButton);
});
// Toggle zen-mode
_toogleZenMode(zendModeButton);
});
}

(function init() {
window.addEventListener("DOMContentLoaded", (event) => {
// Register click on 'zen-mode-button' node element
const zendModeButton = document.getElementById('zen-mode-button');
if(zendModeButton !== null && zendModeButton !== undefined) {
_registerZendModeButtonClick(zendModeButton);
}
});
window.addEventListener("DOMContentLoaded", (event) => {
// Register click on 'zen-mode-button' node element
const zendModeButton = document.getElementById('zen-mode-button');
if (zendModeButton !== null && zendModeButton !== undefined) {
_registerZendModeButtonClick(zendModeButton);
}
});
})();
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
[module.hugoVersion]
extended = true
min = "0.87.0"
max = "0.126.3"
max = "0.127.0"
1 change: 1 addition & 0 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ disableTextInHeader = false
showLikes = false
showTableOfContents = false
showCards = false
orderByWeight = false
groupByYear = true
cardView = false
cardViewScreenWidth = false
Expand Down
1 change: 1 addition & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ smartTOCHideUnfocusedChildren = false
showLikes = false
showTableOfContents = true
showCards = true
orderByWeight = true
groupByYear = false
cardView = true
cardViewScreenWidth = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Advanced Customisation"
date: 2020-08-08
weight: 13
draft: false
description: "Learn how to build Blowfish manually."
slug: "advanced-customisation"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Advanced Customisation"
date: 2020-08-08
weight: 13
draft: false
description: "Learn how to build Blowfish manually."
slug: "advanced-customisation"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/advanced-customisation/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Advanced Customisation"
date: 2020-08-08
weight: 13
draft: false
description: "Learn how to build Blowfish manually."
slug: "advanced-customisation"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 进阶自定义
date: 2020-08-08
weight: 13
draft: false
description: "了解如何手动构建 Blowfish。"
slug: "advanced-customisation"
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/content/docs/configuration/index.it.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Configuration"
date: 2020-08-14
weight: 4
draft: false
description: "All the configuration variables available in Blowfish."
slug: "configuration"
Expand Down Expand Up @@ -258,6 +258,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `list.showViews` | `false` | Whether or not list views are displayed. This requires firebase integrations to be enabled, look below. |
| `list.showLikes` | `false` | Whether or not list likes are displayed. This requires firebase integrations to be enabled, look below. |
| `list.showCards` | `false` | Whether or not each article is displayed as a card or as simple inline text. |
| `list.orderByWeight` | `false` | Whether or not articles are sorted by [weights](https://gohugo.io/methods/page/weight/). |
| `list.groupByYear` | `true` | Whether or not articles are grouped by year on list pages. |
| `list.cardView` | `false` | Display lists as a gallery of cards. |
| `list.cardViewScreenWidth` | `false` | Enhance the width of card galleries in lists to take the full width available. |
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/content/docs/configuration/index.ja.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Configuration"
date: 2020-08-14
weight: 4
draft: false
description: "All the configuration variables available in Blowfish."
slug: "configuration"
Expand Down Expand Up @@ -258,6 +258,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `list.showViews` | `false` | Whether or not list views are displayed. This requires firebase integrations to be enabled, look below. |
| `list.showLikes` | `false` | Whether or not list likes are displayed. This requires firebase integrations to be enabled, look below. |
| `list.showCards` | `false` | Whether or not each article is displayed as a card or as simple inline text. |
| `list.orderByWeight` | `false` | Whether or not articles are sorted by [weights](https://gohugo.io/methods/page/weight/). |
| `list.groupByYear` | `true` | Whether or not articles are grouped by year on list pages. |
| `list.cardView` | `false` | Display lists as a gallery of cards. |
| `list.cardViewScreenWidth` | `false` | Enhance the width of card galleries in lists to take the full width available. |
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/content/docs/configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Configuration"
date: 2020-08-14
weight: 4
draft: false
description: "All the configuration variables available in Blowfish."
slug: "configuration"
Expand Down Expand Up @@ -259,6 +259,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `list.showViews` | `false` | Whether or not list views are displayed. This requires firebase integrations to be enabled, look below. |
| `list.showLikes` | `false` | Whether or not list likes are displayed. This requires firebase integrations to be enabled, look below. |
| `list.showCards` | `false` | Whether or not each article is displayed as a card or as simple inline text. |
| `list.orderByWeight` | `false` | Whether or not articles are sorted by [weights](https://gohugo.io/methods/page/weight/). |
| `list.groupByYear` | `true` | Whether or not articles are grouped by year on list pages. |
| `list.cardView` | `false` | Display lists as a gallery of cards. |
| `list.cardViewScreenWidth` | `false` | Enhance the width of card galleries in lists to take the full width available. |
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/configuration/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "配置"
date: 2020-08-14
weight: 4
draft: false
description: "介绍 Blowfish 中所有可用的的配置变量。"
slug: "configuration"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/content-examples/index.it.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Content Examples"
date: 2020-08-09
weight: 11
draft: false
description: "All the partials available in Blowfish."
slug: "content-examples"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/content-examples/index.ja.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Content Examples"
date: 2020-08-09
weight: 11
draft: false
description: "All the partials available in Blowfish."
slug: "content-examples"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/content-examples/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Content Examples"
date: 2020-08-09
weight: 11
draft: false
description: "All the partials available in Blowfish."
slug: "content-examples"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/content-examples/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "内容示例"
date: 2020-08-09
weight: 11
draft: false
description: "包含 Blowfish 中所有可用部分的示例、"
slug: "content-examples"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/firebase-views/index.it.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Firebase: Views & Likes"
date: 2020-08-03
weight: 15
draft: false
description: "Learn how to integrate Firebase and get dynamic data for views and likes."
slug: "firebase-views"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/firebase-views/index.ja.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Firebase: Views & Likes"
date: 2020-08-03
weight: 15
draft: false
description: "Learn how to integrate Firebase and get dynamic data for views and likes."
slug: "firebase-views"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/firebase-views/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Firebase: Views & Likes"
date: 2020-08-03
weight: 15
draft: false
description: "Learn how to integrate Firebase and get dynamic data for views and likes."
slug: "firebase-views"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/firebase-views/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Firebase: 阅读量 & 点赞量"
date: 2020-08-03
weight: 15
draft: false
description: "了解 Blowfish 如何集成 Firebase,并动态显示阅读量和点赞量。"
slug: "firebase-views"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/front-matter/index.it.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Front Matter"
date: 2020-08-10
weight: 7
draft: false
description: "All the front matter variables available in Blowfish."
slug: "front-matter"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/front-matter/index.ja.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Front Matter"
date: 2020-08-10
weight: 7
draft: false
description: "All the front matter variables available in Blowfish."
slug: "front-matter"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/front-matter/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Front Matter"
date: 2020-08-10
weight: 7
draft: false
description: "All the front matter variables available in Blowfish."
slug: "front-matter"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/front-matter/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Front Matter"
date: 2020-08-10
weight: 7
draft: false
description: "文本主要介绍 Blowfish 中页面中可以添加的所有的 Front Matter 参数。"
slug: "front-matter"
Expand Down
8 changes: 4 additions & 4 deletions exampleSite/content/docs/getting-started/index.it.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Per iniziare"
date: 2020-08-15
weight: 3
draft: false
description: "Tutte le variabili del front matter sono disponibili in Blowfish."
slug: "per-iniziare"
Expand All @@ -26,10 +26,10 @@ The config files that ship with Blowfish contain all of the possible settings th

## Basic configuration

Before creating any content, there are a few things you should set for a new installation. Starting in the `config.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.
Before creating any content, there are a few things you should set for a new installation. Starting in the `hugo.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.

```toml
# config/_default/config.toml
# config/_default/hugo.toml

baseURL = "https://your_domain.com/"
languageCode = "en"
Expand All @@ -40,7 +40,7 @@ The next step is to configure the language settings. Although Blowfish supports
Locate the `languages.en.toml` file in the config folder. If your main language is English you can use this file as is. Otherwise, rename it so that it includes the correct language code in the filename. For example, for French, rename the file to `languages.fr.toml`.

{{< alert >}}
Note that the language code in the language config filename should match the `languageCode` setting in `config.toml`.
Note that the language code in the language config filename should match the `languageCode` setting in `hugo.toml`.
{{< /alert >}}

```toml
Expand Down
8 changes: 4 additions & 4 deletions exampleSite/content/docs/getting-started/index.ja.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Getting Started"
date: 2020-08-15
weight: 3
draft: false
description: "All the front matter variables available in Blowfish."
slug: "getting-started"
Expand All @@ -26,10 +26,10 @@ The config files that ship with Blowfish contain all of the possible settings th

## Basic configuration

Before creating any content, there are a few things you should set for a new installation. Starting in the `config.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.
Before creating any content, there are a few things you should set for a new installation. Starting in the `hugo.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.

```toml
# config/_default/config.toml
# config/_default/hugo.toml

baseURL = "https://your_domain.com/"
languageCode = "en"
Expand All @@ -40,7 +40,7 @@ The next step is to configure the language settings. Although Blowfish supports
Locate the `languages.en.toml` file in the config folder. If your main language is English you can use this file as is. Otherwise, rename it so that it includes the correct language code in the filename. For example, for French, rename the file to `languages.fr.toml`.

{{< alert >}}
Note that the language code in the language config filename should match the `languageCode` setting in `config.toml`.
Note that the language code in the language config filename should match the `languageCode` setting in `hugo.toml`.
{{< /alert >}}

```toml
Expand Down
8 changes: 4 additions & 4 deletions exampleSite/content/docs/getting-started/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Getting Started"
date: 2020-08-15
weight: 3
draft: false
description: "All the front matter variables available in Blowfish."
slug: "getting-started"
Expand All @@ -26,10 +26,10 @@ The config files that ship with Blowfish contain all of the possible settings th

## Basic configuration

Before creating any content, there are a few things you should set for a new installation. Starting in the `config.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.
Before creating any content, there are a few things you should set for a new installation. Starting in the `hugo.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.

```toml
# config/_default/config.toml
# config/_default/hugo.toml

baseURL = "https://your_domain.com/"
languageCode = "en"
Expand All @@ -40,7 +40,7 @@ The next step is to configure the language settings. Although Blowfish supports
Locate the `languages.en.toml` file in the config folder. If your main language is English you can use this file as is. Otherwise, rename it so that it includes the correct language code in the filename. For example, for French, rename the file to `languages.fr.toml`.

{{< alert >}}
Note that the language code in the language config filename should match the `languageCode` setting in `config.toml`.
Note that the language code in the language config filename should match the `languageCode` setting in `hugo.toml`.
{{< /alert >}}

```toml
Expand Down
Loading

0 comments on commit efba32b

Please sign in to comment.