Compare commits

...

10 Commits

Author SHA1 Message Date
Raymundo Vásquez Ruiz
8d62eaf0d5 feat: an "end" partial
Some checks failed
Deploy Hextra docs site to Pages / build (push) Failing after 1m19s
Deploy Hextra docs site to Pages / deploy (push) Has been skipped
2026-03-23 12:09:50 +01:00
Raymundo Vásquez Ruiz
4f547d63e2 feat: disable toc by default 2026-03-21 20:17:17 +01:00
Raymundo Vásquez Ruiz
f02859dc4d feat: sidebar oculto por defecto 2026-03-17 12:02:03 -06:00
yuri
9466af337f chore(docs): link KaTeX (#860) 2025-11-28 01:04:09 +00:00
PrintN
0e8982876a chore: Update Beginner Privacy showcase image and add PrintN website (#859) 2025-11-28 01:03:00 +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
Kowyo
708358de80 fix: enhance table readability (#826)
* feat: enhance table readability

* use v0.9.0 table style

* Update table styles

---------

Co-authored-by: Xin <xin@imfing.com>
2025-09-15 21:59:05 +01:00
ghac101
8699deb1dd fix(analytics): change default umami analytics file to script.js (#835)
Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>
2025-09-15 21:28:27 +01:00
24 changed files with 162 additions and 65 deletions

File diff suppressed because one or more lines are too long

View File

@@ -33,19 +33,19 @@
@apply hx:border-black/4 hx:bg-black/3 hx:break-words hx:rounded-md hx:border hx:py-0.5 hx:px-[.25em] hx:text-[.9em] hx:dark:border-white/10 hx:dark:bg-white/10; @apply hx:border-black/4 hx:bg-black/3 hx:break-words hx:rounded-md hx:border hx:py-0.5 hx:px-[.25em] hx:text-[.9em] hx:dark:border-white/10 hx:dark:bg-white/10;
} }
:where(table):not(:where(.hextra-code-block table, [class~=not-prose],[class~=not-prose] *)) { :where(table):not(:where(.hextra-code-block table, [class~=not-prose],[class~=not-prose] *)) {
@apply hx:block hx:overflow-x-auto hx:my-6 hx:p-0 hx:first:mt-0 hx:w-full hx:text-sm hx:leading-5; @apply hx:block hx:overflow-x-auto hx:my-6 hx:p-0 hx:first:mt-0 hx:w-full hx:text-sm hx:leading-5 hx:border-collapse;
thead { thead {
@apply hx:border-b hx:border-gray-200 hx:dark:border-neutral-800; @apply hx:bg-gray-50 hx:dark:bg-gray-600/20;
} }
tbody tr { tr {
@apply hx:m-0 hx:border-b hx:border-gray-100 hx:dark:border-neutral-800/50; @apply hx:m-0 hx:border-t hx:border-gray-300 hx:p-0 hx:dark:border-gray-600;
} }
th { th {
@apply hx:m-0 hx:p-2 hx:font-semibold hx:first:pl-0 hx:last:pr-0; @apply hx:m-0 hx:border hx:border-gray-300 hx:p-2 hx:font-semibold hx:dark:border-gray-600;
} }
td { td {
@apply hx:m-0 hx:p-2 hx:first:pl-0 hx:last:pr-0; @apply hx:m-0 hx:border hx:border-gray-300 hx:p-2 hx:dark:border-gray-600;
} }
} }
:where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) { :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) {

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 ### 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: 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/). > 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. > 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`: To enable [Umami](https://umami.is/docs/), set `params.analytics.umami.serverURL` and `params.analytics.umami.websiteID` flag in `hugo.yaml`:
@@ -419,7 +427,7 @@ params:
umami: umami:
serverURL: "https://example.com" serverURL: "https://example.com"
websiteID: "94db1cb1-74f4-4a40-ad6c-962362670409" websiteID: "94db1cb1-74f4-4a40-ad6c-962362670409"
# scriptName: "umami.js" # optional (default: umami.js) # scriptName: "script.js" # optional (default: script.js)
# https://umami.is/docs/tracker-configuration#data-host-url # https://umami.is/docs/tracker-configuration#data-host-url
# hostURL: "http://stats.example.org" # optional # hostURL: "http://stats.example.org" # optional
# https://umami.is/docs/tracker-configuration#data-auto-track # https://umami.is/docs/tracker-configuration#data-auto-track
@@ -436,7 +444,7 @@ params:
# doNotTrack: "true" # optional # 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`: 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" 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 ### 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`: 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

@@ -3,7 +3,7 @@ title: "LaTeX"
weight: 4 weight: 4
--- ---
عبارات ریاضی LaTeX به طور پیش‌فرض با استفاده از \(\KaTeX\) نمایش داده می‌شوند. کافی است آن‌ها را در محتوای Markdown خود قرار دهید بدون نیاز به هیچ پیکربندی دستی. عبارات ریاضی LaTeX به طور پیش‌فرض با استفاده از \(\KaTeX\) ([katex.org](https://katex.org/)) نمایش داده می‌شوند. کافی است آن‌ها را در محتوای Markdown خود قرار دهید بدون نیاز به هیچ پیکربندی دستی.
## نحوه استفاده ## نحوه استفاده

View File

@@ -3,7 +3,7 @@ title: "LaTeX"
weight: 4 weight: 4
--- ---
LaTeX の数式表現はデフォルトで \(\KaTeX\) を使用してレンダリングされます。特別な設定なしで、Markdown コンテンツ内に直接記述できます。 LaTeX の数式表現はデフォルトで \(\KaTeX\) ([katex.org](https://katex.org/)) を使用してレンダリングされます。特別な設定なしで、Markdown コンテンツ内に直接記述できます。
## 使用方法 ## 使用方法

View File

@@ -3,7 +3,7 @@ title: "LaTeX"
weight: 4 weight: 4
--- ---
LaTeX math expressions are rendered using \(\KaTeX\) by default. Simply start including them in your Markdown content without any manual configurations. LaTeX math expressions are rendered using \(\KaTeX\) ([katex.org](https://katex.org/)) by default. Simply start including them in your Markdown content without any manual configurations.
## Usage ## Usage

View File

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

View File

@@ -8,36 +8,36 @@ title: 詳細
## 例 ## 例
{{% details title="詳細" %}} {{< details title="詳細" >}}
これは詳細のコンテンツです。 これは詳細のコンテンツです。
Markdown は **サポートされています** Markdown は **サポートされています**
{{% /details %}} {{< /details >}}
{{% details title="クリックして表示" closed="true" %}} {{< details title="クリックして表示" closed="true" >}}
これはデフォルトで非表示になります。 これはデフォルトで非表示になります。
{{% /details %}} {{< /details >}}
## 使用方法 ## 使用方法
````markdown ````markdown
{{%/* details title="詳細" */%}} {{</* details title="詳細" */>}}
これは詳細のコンテンツです。 これは詳細のコンテンツです。
Markdown は **サポートされています**。 Markdown は **サポートされています**。
{{%/* /details */%}} {{</* /details */>}}
```` ````
````markdown ````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 ## Example
{{% details title="Details" %}} {{< details title="Details" >}}
This is the content of the details. This is the content of the details.
Markdown is **supported**. 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. This will be hidden by default.
{{% /details %}} {{< /details >}}
## Usage ## Usage
````markdown ````markdown
{{%/* details title="Details" */%}} {{</* details title="Details" */>}}
This is the content of the details. This is the content of the details.
Markdown is **supported**. Markdown is **supported**.
{{%/* /details */%}} {{</* /details */>}}
```` ````
````markdown ````markdown
{{%/* details title="Click me to reveal" closed="true" */%}} {{</* details title="Click me to reveal" closed="true" */>}}
This will be hidden by default. This will be hidden by default.
{{%/* /details */%}} {{</* /details */>}}
```` ````

View File

@@ -8,36 +8,36 @@ title: 详情
## 示例 ## 示例
{{% details title="详情" %}} {{< details title="详情" >}}
这是详情的内容。 这是详情的内容。
支持 **Markdown** 格式。 支持 **Markdown** 格式。
{{% /details %}} {{< /details >}}
{{% details title="点击我展开" closed="true" %}} {{< details title="点击我展开" closed="true" >}}
默认情况下,这部分内容会被隐藏。 默认情况下,这部分内容会被隐藏。
{{% /details %}} {{< /details >}}
## 使用方法 ## 使用方法
````markdown ````markdown
{{%/* details title="详情" */%}} {{</* details title="详情" */>}}
这是详情的内容。 这是详情的内容。
支持 **Markdown** 格式。 支持 **Markdown** 格式。
{{%/* /details */%}} {{</* /details */>}}
```` ````
````markdown ````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. 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 ## Example
{{% steps %}} {{% steps %}}
@@ -16,6 +18,10 @@ This is the first step.
This is the second step. This is the second step.
#### Step subheading {class="no-step-marker"}
This will not be counted as a step.
### Step 3 ### Step 3
This is the third step. This is the third step.
@@ -43,5 +49,9 @@ This is the first step.
This is the second step. This is the second step.
#### Step subheading {class="no-step-marker"}
This will not be counted as a step.
{{%/* /steps */%}} {{%/* /steps */%}}
``` ```

View File

@@ -12,10 +12,17 @@ layout: wide
</p> </p>
{{< cards >}} {{< cards >}}
{{< card
link="https://printn.dev"
title="PrintN"
image="https://raw.githubusercontent.com/printn/printn.github.io/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card {{< card
link="https://beginnerprivacy.com" link="https://beginnerprivacy.com"
title="Beginner Privacy" title="Beginner Privacy"
image="https://github.com/user-attachments/assets/a72582a8-7c54-40cd-b8e3-8fd77164687c" image="https://raw.githubusercontent.com/beginnerprivacy/beginnerprivacy.com/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;" imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}} >}}

View File

@@ -12,10 +12,17 @@ Hextra で構築されたオープンソースプロジェクト
</p> </p>
{{< cards >}} {{< cards >}}
{{< card
link="https://printn.dev"
title="PrintN"
image="https://raw.githubusercontent.com/printn/printn.github.io/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card {{< card
link="https://beginnerprivacy.com" link="https://beginnerprivacy.com"
title="Beginner Privacy" title="Beginner Privacy"
image="https://github.com/user-attachments/assets/a72582a8-7c54-40cd-b8e3-8fd77164687c" image="https://raw.githubusercontent.com/beginnerprivacy/beginnerprivacy.com/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;" imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}} >}}

View File

@@ -12,10 +12,17 @@ Open source projects powered by Hextra
</p> </p>
{{< cards >}} {{< cards >}}
{{< card
link="https://printn.dev"
title="PrintN"
image="https://raw.githubusercontent.com/printn/printn.github.io/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card {{< card
link="https://beginnerprivacy.com" link="https://beginnerprivacy.com"
title="Beginner Privacy" title="Beginner Privacy"
image="https://github.com/user-attachments/assets/a72582a8-7c54-40cd-b8e3-8fd77164687c" image="https://raw.githubusercontent.com/beginnerprivacy/beginnerprivacy.com/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;" imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}} >}}

View File

@@ -12,10 +12,17 @@ layout: wide
</p> </p>
{{< cards >}} {{< cards >}}
{{< card
link="https://printn.dev"
title="PrintN"
image="https://raw.githubusercontent.com/printn/printn.github.io/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card {{< card
link="https://beginnerprivacy.com" link="https://beginnerprivacy.com"
title="Beginner Privacy" title="Beginner Privacy"
image="https://github.com/user-attachments/assets/a72582a8-7c54-40cd-b8e3-8fd77164687c" image="https://raw.githubusercontent.com/beginnerprivacy/beginnerprivacy.com/refs/heads/main/static/images/screenshot.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;" imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}} >}}

View File

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

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ https://umami.is/docs/tracker-configuration
{{- $attributes := newScratch -}} {{- $attributes := newScratch -}}
{{- $attributes.SetInMap "umami" "src" (printf "%s/%s" .serverURL (.scriptName | default "umami.js")) -}} {{- $attributes.SetInMap "umami" "src" (printf "%s/%s" .serverURL (.scriptName | default "script.js")) -}}
{{- $attributes.SetInMap "umami" "data-website-id" .websiteID -}} {{- $attributes.SetInMap "umami" "data-website-id" .websiteID -}}
{{- if .hostURL -}} {{- if .hostURL -}}

View File

@@ -0,0 +1 @@
{{- partial "custom/end.html" -}}

View File

@@ -1,6 +1,6 @@
{{- $context := .context -}} {{- $context := .context -}}
{{- $disableSidebar := .disableSidebar | default false -}} {{- $disableSidebar := .disableSidebar | default true -}}
{{- $displayPlaceholder := .displayPlaceholder | default false -}} {{- $displayPlaceholder := .displayPlaceholder | default false -}}
{{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}} {{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}}

View File

@@ -1,6 +1,6 @@
{{/* Table of Contents */}} {{/* Table of Contents */}}
{{/* TODO: toc bottom part should be able to hide */}} {{/* TODO: toc bottom part should be able to hide */}}
{{- $toc := .Params.toc | default true -}} {{- $toc := .Params.toc | default false -}}
{{- $onThisPage := (T "onThisPage") | default "On this page"}} {{- $onThisPage := (T "onThisPage") | default "On this page"}}
{{- $tags := (T "tags") | default "Tags"}} {{- $tags := (T "tags") | default "Tags"}}
{{- $editThisPage := (T "editThisPage") | default "Edit this page"}} {{- $editThisPage := (T "editThisPage") | default "Edit this page"}}

View File

@@ -8,6 +8,7 @@
{{- if or (eq .Site.Params.footer.enable nil) (.Site.Params.footer.enable) }} {{- if or (eq .Site.Params.footer.enable nil) (.Site.Params.footer.enable) }}
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
{{ end }} {{ end }}
{{ partial "end.html" .}}
{{ partial "scripts.html" . }} {{ partial "scripts.html" . }}
</body> </body>
</html> </html>