Compare commits

...

4 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
e56169291c Initial plan 2025-10-20 15:30:21 +00:00
Keith Stockdale
3551a56b8c feat: support GoatCounter analytics (#814)
* feat: support GoatCounter analytics

* docs: add docs for GoatCounter analytics

refactor: move analytics documentation into its own section since there are now 4 supported analytics solutions

* fix: addressing issues raised in PR

* refactor: simplifying goat counter setting logic.
refactor: simplify error handling with goat counter

* fix: fixing goat counter erroring when a code is provided

* fix: Applying suggested fixes

* Update layouts/_partials/components/analytics/goat-counter.html

---------

Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>
2025-10-13 22:50:19 +01:00
Bubbler
bfeae19076 docs(details): change details shortcode calls to angle brackets (#855)
Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>
2025-10-12 23:07:24 +01:00
Paul Marrapese
b7f4bffce6 feat(shortcode): added markdown attribute support for headers (#851)
docs: added "no-step-marker" example for steps
2025-10-11 23:13:04 +01:00
10 changed files with 112 additions and 45 deletions

View File

@@ -383,16 +383,6 @@ excludeSearch: true
---
```
### Google Analytics
To enable [Google Analytics](https://marketingplatform.google.com/about/analytics/), set `services.googleAnalytics.ID` flag in `hugo.yaml`:
```yaml {filename="hugo.yaml"}
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```
### Google Search Index
To [block Google Search](https://developers.google.com/search/docs/crawling-indexing/block-indexing) from indexing a page, set `noindex` to true in your page frontmatter:
@@ -409,7 +399,25 @@ To exclude an entire directory, use the [`cascade`](https://gohugo.io/configurat
> To block search crawlers, you can make a [`robots.txt` template](https://gohugo.io/templates/robots/).
> However, `robots.txt` instructions do not necessarily keep a page out of Google search results.
### Umami Analytics
### Analytics
Hextra has support for several different analytics solutions. Hextra only supports analytics in production environments. This is to ensure that you do not accidentally send analytic events when working locally. If, however, you do want to test analytics locally, you can run a production server using:
```
hugo server --environment production
```
#### Google Analytics
To enable [Google Analytics](https://marketingplatform.google.com/about/analytics/), set `services.googleAnalytics.ID` flag in `hugo.yaml`:
```yaml {filename="hugo.yaml"}
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```
#### Umami Analytics
To enable [Umami](https://umami.is/docs/), set `params.analytics.umami.serverURL` and `params.analytics.umami.websiteID` flag in `hugo.yaml`:
@@ -436,7 +444,7 @@ params:
# doNotTrack: "true" # optional
```
### Matomo Analytics
#### Matomo Analytics
To enable [Matomo](https://matomo.org/), set `params.analytics.matomo.URL` and `params.analytics.matomo.ID` flag in `hugo.yaml`:
@@ -448,6 +456,32 @@ params:
websiteID: "94db1cb1-74f4-4a40-ad6c-962362670409"
```
#### GoatCounter Analytics
To enable [GoatCounter](https://www.goatcounter.com/), set `params.analytics.goatCounter.code` in `hugo.yaml`
All settings available here are mirrors of the settings described in GoatCounter [settings](https://www.goatcounter.com/help/js#settings-44186)
```yaml {filename="hugo.yaml"}
params:
analytics:
goatCounter:
code: "ABCDE"
# Optional Settings
#------------------
# disables automatic collection of data
# noOnload: true
# disables event binding. See more here https://www.goatcounter.com/help/events
# noEvents: true
# allows data collection from local addresses. Use this with a production environment to test locally
# allowLocal: true
# Allow data collection when a page is loaded in a frame or iframe
# allowFrame: true
```
### LLMS.txt Support
To enable [llms.txt](https://llmstxt.org/) output format for your site, which provides a structured text outline for [large language models](https://en.wikipedia.org/wiki/Large_language_model) and AI agents, add the `llms` output format to your site's `hugo.yaml`:

View File

@@ -8,36 +8,36 @@ title: جزئیات
## مثال
{{% details title="جزئیات" %}}
{{< details title="جزئیات" >}}
این محتوای جزئیات است.
مارک‌داون **پشتیبانی می‌شود**.
{{% /details %}}
{{< /details >}}
{{% details title="برای نمایش کلیک کنید" closed="true" %}}
{{< details title="برای نمایش کلیک کنید" closed="true" >}}
این به‌صورت پیش‌فرض مخفی خواهد بود.
{{% /details %}}
{{< /details >}}
## نحوه استفاده
````markdown
{{%/* details title="جزئیات" */%}}
{{</* details title="جزئیات" */>}}
این محتوای جزئیات است.
مارک‌داون **پشتیبانی می‌شود**.
{{%/* /details */%}}
{{</* /details */>}}
````
````markdown
{{%/* details title="برای نمایش کلیک کنید" closed="true" */%}}
{{</* details title="برای نمایش کلیک کنید" closed="true" */>}}
این به‌صورت پیش‌فرض مخفی خواهد بود.
{{%/* /details */%}}
{{</* /details */>}}
````

View File

@@ -8,36 +8,36 @@ title: 詳細
## 例
{{% details title="詳細" %}}
{{< details title="詳細" >}}
これは詳細のコンテンツです。
Markdown は **サポートされています**
{{% /details %}}
{{< /details >}}
{{% details title="クリックして表示" closed="true" %}}
{{< details title="クリックして表示" closed="true" >}}
これはデフォルトで非表示になります。
{{% /details %}}
{{< /details >}}
## 使用方法
````markdown
{{%/* details title="詳細" */%}}
{{</* details title="詳細" */>}}
これは詳細のコンテンツです。
Markdown は **サポートされています**。
{{%/* /details */%}}
{{</* /details */>}}
````
````markdown
{{%/* details title="クリックして表示" closed="true" */%}}
{{</* details title="クリックして表示" closed="true" */>}}
これはデフォルトで非表示になります。
{{%/* /details */%}}
{{</* /details */>}}
````

View File

@@ -8,36 +8,36 @@ A built-in component to display a collapsible content.
## Example
{{% details title="Details" %}}
{{< details title="Details" >}}
This is the content of the details.
Markdown is **supported**.
{{% /details %}}
{{< /details >}}
{{% details title="Click me to reveal" closed="true" %}}
{{< details title="Click me to reveal" closed="true" >}}
This will be hidden by default.
{{% /details %}}
{{< /details >}}
## Usage
````markdown
{{%/* details title="Details" */%}}
{{</* details title="Details" */>}}
This is the content of the details.
Markdown is **supported**.
{{%/* /details */%}}
{{</* /details */>}}
````
````markdown
{{%/* details title="Click me to reveal" closed="true" */%}}
{{</* details title="Click me to reveal" closed="true" */>}}
This will be hidden by default.
{{%/* /details */%}}
{{</* /details */>}}
````

View File

@@ -8,36 +8,36 @@ title: 详情
## 示例
{{% details title="详情" %}}
{{< details title="详情" >}}
这是详情的内容。
支持 **Markdown** 格式。
{{% /details %}}
{{< /details >}}
{{% details title="点击我展开" closed="true" %}}
{{< details title="点击我展开" closed="true" >}}
默认情况下,这部分内容会被隐藏。
{{% /details %}}
{{< /details >}}
## 使用方法
````markdown
{{%/* details title="详情" */%}}
{{</* details title="详情" */>}}
这是详情的内容。
支持 **Markdown** 格式。
{{%/* /details */%}}
{{</* /details */>}}
````
````markdown
{{%/* details title="点击我展开" closed="true" */%}}
{{</* details title="点击我展开" closed="true" */>}}
默认情况下,这部分内容会被隐藏。
{{%/* /details */%}}
{{</* /details */>}}
````

View File

@@ -4,6 +4,8 @@ title: Steps
A built-in component to display a series of steps.
You can use the Markdown attribute `{class="no-step-marker"}` to prevent a heading from being counted as a step.
## Example
{{% steps %}}
@@ -16,6 +18,10 @@ This is the first step.
This is the second step.
#### Step subheading {class="no-step-marker"}
This will not be counted as a step.
### Step 3
This is the third step.
@@ -43,5 +49,9 @@ This is the first step.
This is the second step.
#### Step subheading {class="no-step-marker"}
This will not be counted as a step.
{{%/* /steps */%}}
```

View File

@@ -715,6 +715,7 @@
"msupsub",
"mtable",
"mtight",
"no-step-marker",
"not-prose",
"nulldelimiter",
"op-symbol",

View File

@@ -1,4 +1,4 @@
<h{{ .Level }}>
<h{{ .Level }} {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
{{- .Text | safeHTML -}}
{{- if gt .Level 1 -}}
<span class="hx:absolute hx:-mt-20" id="{{ .Anchor | safeURL }}"></span>

View File

@@ -16,4 +16,9 @@
{{ partial "components/analytics/matomo.html" . }}
{{- end }}
<!-- GoatCounter -->
{{- if .Site.Params.analytics.goatCounter -}}
{{ partial "components/analytics/goat-counter.html" . }}
{{- end -}}
{{- end }}

View File

@@ -0,0 +1,17 @@
{{- with .Site.Params.analytics.goatCounter -}}
{{- if not .code -}}
{{- errorf "Missing GoatCounter 'code' configuration. See https://imfing.github.io/hextra/versions/latest/docs/guide/configuration/#goatcounter-analytics" -}}
{{- end -}}
<script
data-goatcounter="https://{{ .code }}.goatcounter.com/count"
data-goatcounter-settings='
{
"no_onload":{{ .noOnload | default false }},
"no_events":{{ .noEvents | default false }},
"allow_local":{{ .allowLocal | default false }},
"allow_frame":{{ .allowFrame | default false }}
}
'
async src="//gc.zgo.at/count.js"></script>
{{- end -}}