Compare commits

...

12 Commits

Author SHA1 Message Date
Seth Rose d92cf12968
Merge 5a0a0b8d5b into 577d2bbe6e 2024-04-17 16:42:49 -05:00
James Panther 577d2bbe6e
📝 Update changelog 2024-04-17 15:11:56 +10:00
James Panther 26159437b7
🔀 Merge pull request #849 from ItsSunnyMonster/add-theme-color
 add defaultThemeColor option
2024-04-17 15:10:10 +10:00
James Panther b9ffd9598d
🔀 Merge pull request #832 from fmaida/fmaida
Add support for Umami Analytics
2024-04-17 15:08:10 +10:00
James Panther a6e1afcc80
📝 Update changelog 2024-04-17 15:06:32 +10:00
James Panther f6eef7257b
🔀 Merge pull request #851 from clouvet/bluesky-icon
Add icon for Bluesky social network
2024-04-17 15:05:02 +10:00
Christopher Louvet 480d921cef Add Bluesky icon 2024-04-04 09:45:12 +07:00
ItsSunnyMonster 4f65d3bf4e
add defaultThemeColor option 2024-04-01 19:43:01 +13:00
Seth Rose 5a0a0b8d5b Fixes incorrect language codes referenced in the baseof.html template by updating the lang attribute to use .Site.Language.LanguageCode instead of site.Language.LanguageCode and .Site.Language.LanguageDirection instead of site.Language.LanguageDirection, ensuring the HTML language matches the configuration. 2024-03-26 16:37:56 -05:00
Francesco Maida 78560462ca Add Umami Analytics info to the documentation (in the english version) 📝 2024-03-17 21:00:55 +01:00
Francesco Maida c816c5fc3d Added support for Umami Analytics See #829 for further references. 2024-03-16 17:28:00 +01:00
Francesco Maida 4d5643f861 Added support for Umami Analytics. See #829 for further references. 2024-03-16 17:13:29 +01:00
17 changed files with 54 additions and 5 deletions

View File

@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
### Added
- Umami Analytics support ([#832](https://github.com/jpanther/congo/pull/832))
- Theme parameter to set a default HTML theme colour ([#849](https://github.com/jpanther/congo/pull/849))
- New icon for `bluesky` ([#851](https://github.com/jpanther/congo/pull/851))
## [2.8.2] - 2024-04-17
### Added

View File

@ -28,7 +28,7 @@ Congo is designed to be a powerful, lightweight theme for [Hugo](https://gohugo.
- Heading anchors, Tables of Contents, Code copy, Buttons, Badges and more
- HTML and Emoji support in articles 🎉
- SEO friendly with links for sharing to social media
- Fathom Analytics and Google Analytics support
- Fathom Analytics, Plausible Analytics, Umami Analytics and Google Analytics support
- RSS feeds, Favicons and comments support
- Advanced customisation using simple Tailwind colour definitions and styles
- Optimised for performance and accessibility with perfect Lighthouse scores

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M407.8 294.7c-3.3-.4-6.7-.8-10-1.3c3.4 .4 6.7 .9 10 1.3zM288 227.1C261.9 176.4 190.9 81.9 124.9 35.3C61.6-9.4 37.5-1.7 21.6 5.5C3.3 13.8 0 41.9 0 58.4S9.1 194 15 213.9c19.5 65.7 89.1 87.9 153.2 80.7c3.3-.5 6.6-.9 10-1.4c-3.3 .5-6.6 1-10 1.4C74.3 308.6-9.1 342.8 100.3 464.5C220.6 589.1 265.1 437.8 288 361.1c22.9 76.7 49.2 222.5 185.6 103.4c102.4-103.4 28.1-156-65.8-169.9c-3.3-.4-6.7-.8-10-1.3c3.4 .4 6.7 .9 10 1.3c64.1 7.1 133.6-15.1 153.2-80.7C566.9 194 576 75 576 58.4s-3.3-44.7-21.6-52.9c-15.8-7.1-40-14.9-103.2 29.8C385.1 81.9 314.1 176.4 288 227.1z"/></svg>

After

Width:  |  Height:  |  Size: 786 B

View File

@ -9,6 +9,8 @@ colorScheme = "congo"
defaultAppearance = "light" # valid options: light or dark
autoSwitchAppearance = true
defaultThemeColor = "#FFFFFF"
enableSearch = false
enableCodeCopy = false
enableImageLazyLoading = true
@ -75,6 +77,10 @@ fingerprintAlgorithm = "sha256"
# event = ""
# script = ""
#[umamiAnalytics]
# site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# region = "eu" # can be either "eu" or "us"
[verification]
# google = ""
# bing = ""

View File

@ -71,6 +71,10 @@ fingerprintAlgorithm = "sha256"
[fathomAnalytics]
# site = "ABC12345"
#[umamiAnalytics]
# site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# region = "eu" # Can be either "eu" or "us"
[verification]
# google = ""
# bing = ""

View File

@ -129,6 +129,7 @@ Congoはテーマの機能を制御する多数の設定パラメーターを提
|Name|Default|Description|
|---|---|---|
|`colorScheme`|`"congo"`|使用する配色。有効な値は `congo` (デフォルト), `avocado`, `cherry`, `fire`, `ocean`, `sapphire`, `slate` です。詳しくは [カラースキーム]({{< ref "getting-started#カラースキーム" >}})セクションを参照してください。|
|`defaultThemeColor`|`"#FFFFFF"`|まだ翻訳されていません。|
|`defaultAppearance`|`"light"`|デフォルトのテーマ外観、 `light` または `dark` のいずれか。|
|`autoSwitchAppearance`|`true`|テーマの外観を訪問者のオペレーティングシステムの設定に基づいて自動的に切り替えるかどうか。常に `defaultAppearance` を使うようにするには `false` を設定します。|
|`enableSearch`|`false`|サイト内検索を有効にするかどうか。検索機能を有効にするには `true` を設定します。検索機能は、[サイト設定](#サイト設定)の `outputs.home` が正しく設定されているかどうかに依存することに注意してください。|

View File

@ -129,6 +129,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|Name|Default|Description|
|---|---|---|
|`colorScheme`|`"congo"`|The theme colour scheme to use. Valid values are `congo` (default), `avocado`, `cherry`, `fire`, `ocean`, `sapphire` and `slate`. Refer to the [Colour Schemes]({{< ref "getting-started#colour-schemes" >}}) section for more details.|
|`defaultThemeColor`|`"#FFFFFF"`|The original value (before any scripts modify it) to use for the `theme-color` meta tag. The meta tag will be changed based on the theme (`light` or `dark`) but it is useful for services that source the original value this tag to display an accent color (e.g. Discord)|
|`defaultAppearance`|`"light"`|The default theme appearance, either `light` or `dark`.|
|`autoSwitchAppearance`|`true`|Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`.|
|`enableSearch`|`false`|Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly.|
@ -178,6 +179,8 @@ Many of the article defaults here can be overridden on a per article basis by sp
|`plausibleAnalytics.domain`|_Not set_|Enter the domain of the website you want to track. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`plausibleAnalytics.event`|_Not set_|Plausible api event proxied URL. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`plausibleAnalytics.script`|_Not set_|Plausible analysis script proxied URL. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`umamiAnalytics.site`|_Not set_|The tracking code generated by Umami Analytics for the website. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`umamiAnalytics.region`|`eu`|Select the Umami Analytics server region to connect to. The value is a string that can be either `eu` or `us`.|
|`verification.google`|_Not set_|The site verification string provided by Google to be included in the site metadata.|
|`verification.bing`|_Not set_|The site verification string provided by Bing to be included in the site metadata.|
|`verification.pinterest`|_Not set_|The site verification string provided by Pinterest to be included in the site metadata.|

View File

@ -125,6 +125,7 @@ Congo 提供了大量的配置参数,用于控制主题的功能。下表概
|名称|默认值|描述|
|---|---|---|
|`colorScheme`|`"congo"`|要使用的主题颜色方案。有效值为 `congo`(默认)、`avocado`、`cherry`、`fire`、`ocean`、`sapphire` 和 `slate`。有关详细信息,请参阅[颜色方案]({{< ref "getting-started#颜色方案" >}})部分。|
|`defaultThemeColor`|`"#FFFFFF`|`theme-color` meta 标签的原值在脚本修改它之前。meta 标签会根据所选主题而变化(`light` 或 `dark`),但是一些软件(例如 Discord会使用该标签的原值来显示主题色。|
|`defaultAppearance`|`"light"`|默认的主题外观,可以是 `light``dark`。|
|`autoSwitchAppearance`|`true`|主题外观是否根据访问者的操作系统首选项自动切换。设置为 `false` 以始终使用 `defaultAppearance`。|
|`enableSearch`|`false`|是否启用站内搜索。设置为 `true` 以启用搜索功能。请注意,搜索功能取决于 [站点配置](#site-configuration) 中的 `outputs.home` 设置正确。|

View File

@ -40,6 +40,18 @@ To enable Plausible analytics support, simply provide the domain of the website
script = "https://plausible.yoursite.com/js/script.js"
```
### Umami Analytics
To enable support for Umami Analytics, insert the *tracking code token* provided by Umami into the `site` parameter to monitor the site. You can also insert a `region` parameter to indicate the region of Umami Analytics servers that you want to connect to. The values can be `eu` or `us`. Refer to [getting started section at umami.is](https://umami.is/docs/getting-started) for more details.
```toml
# config/_default/params.toml
[umamiAnalytics]
site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
region = "eu" # can be either "eu" or "us"
```
### Google Analytics
Google Analytics support is provided through the internal Hugo partial. Simply provide the `googleAnalytics` key in the `config/_default/config.toml` file and the script will be added automatically.

View File

@ -21,6 +21,7 @@ Die vollständige Liste der integrierten Icons und ihre entsprechenden Namen fin
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |

View File

@ -21,6 +21,7 @@ La lista completa de íconos incorporados y sus nombres correspondientes se pued
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |

View File

@ -21,6 +21,7 @@ Congo は[FontAwesome 6](https://fontawesome.com/icons)のアイコンをサポ
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |

View File

@ -21,6 +21,7 @@ The full list of built-in icons and their corresponding names can referenced bel
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |

View File

@ -21,6 +21,7 @@ Congo内置了对多个[FontAwesome 6](https://fontawesome.com/icons)图标的
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |

View File

@ -2,8 +2,8 @@
{{- partial "partials/functions/init.html" . -}}
<!doctype html>
<html
lang="{{- site.Language.LanguageCode | default "" -}}"
dir="{{- site.Language.LanguageDirection | default "ltr" -}}"
lang="{{- .Site.Language.LanguageCode | default "" -}}"
dir="{{- .Site.Language.LanguageDirection | default "ltr" -}}"
class="scroll-smooth"
data-default-appearance="{{- .Site.Params.defaultAppearance | default "light" -}}"
data-auto-appearance="{{- .Site.Params.autoSwitchAppearance | default "true" -}}"

View File

@ -10,5 +10,15 @@
src="{{ default "https://plausible.io/js/script.js" site.Params.plausibleAnalytics.script }}"
></script>
{{ end }}
{{ with site.Params.umamiAnalytics }}
{{- $region := "eu" }}
{{- if isset . "region" }}
{{- $region = .region }}
{{- end }}
<script defer
src="https://{{ $region }}.umami.is/script.js"
data-website-id="{{ .site }}">
</script>
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}

View File

@ -1,7 +1,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="rgb(255,255,255)" />
<meta name="theme-color" content="{{ .Site.Params.defaultThemeColor | default "#ffffff" }}" />
{{/* Title */}}
{{ if .IsHome -}}
<title>{{ .Site.Title | emojify }}</title>