From 984bff11b0cb6e38a3594e1d303c0e083ee43870 Mon Sep 17 00:00:00 2001 From: beer-psi Date: Thu, 27 Feb 2025 11:37:58 +0700 Subject: [PATCH 1/4] Add GoatCounter analytics --- mkdocs.yml | 9 ++++- .../integrations/analytics/custom.html | 37 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 overrides/partials/integrations/analytics/custom.html diff --git a/mkdocs.yml b/mkdocs.yml index 38560bc5..eb0be3f9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -180,6 +180,7 @@ not_in_nav: | theme: name: material + custom_dir: overrides logo: img/logo/website-logo.svg favicon: img/favicon.ico icon: @@ -211,6 +212,7 @@ theme: name: Switch to system preference features: - content.code.annotate + - navigation.instant markdown_extensions: - admonition @@ -236,4 +238,9 @@ markdown_extensions: plugins: - search - - git-revision-date-localized \ No newline at end of file + - git-revision-date-localized + +extra: + analytics: + provider: custom + property: https://two-torial.goatcounter.com/count diff --git a/overrides/partials/integrations/analytics/custom.html b/overrides/partials/integrations/analytics/custom.html new file mode 100644 index 00000000..a1ed9935 --- /dev/null +++ b/overrides/partials/integrations/analytics/custom.html @@ -0,0 +1,37 @@ + +{# + The below code block is for handling "instant navigation" in Material MkDocs. + It is currently not applicable to us, but if we wish to switch to it in the future, + this will properly handle URL changes for analytics. +#} +{% if "navigation.instant" in config.theme.features %} + +{% endif %} + From eee6922d961231477945e2c4ab184145ce2ae49f Mon Sep 17 00:00:00 2001 From: beer-psi Date: Thu, 27 Feb 2025 11:38:22 +0700 Subject: [PATCH 2/4] fix: oops do not allow local --- overrides/partials/integrations/analytics/custom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overrides/partials/integrations/analytics/custom.html b/overrides/partials/integrations/analytics/custom.html index a1ed9935..e5cfc05b 100644 --- a/overrides/partials/integrations/analytics/custom.html +++ b/overrides/partials/integrations/analytics/custom.html @@ -1,7 +1,7 @@ {# From 959478dbbe6180e4bef1b7f81f3e5122b1a56d48 Mon Sep 17 00:00:00 2001 From: beer-psi Date: Thu, 27 Feb 2025 11:42:30 +0700 Subject: [PATCH 3/4] disable instant nav --- mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index eb0be3f9..e2ced167 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -212,7 +212,6 @@ theme: name: Switch to system preference features: - content.code.annotate - - navigation.instant markdown_extensions: - admonition From 31675249db2e0d22668395c28e63ea17d7fc8e85 Mon Sep 17 00:00:00 2001 From: Akitake Date: Thu, 27 Feb 2025 13:00:42 +0100 Subject: [PATCH 4/4] Update mkdocs.yml --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index e2ced167..e050ae46 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -242,4 +242,4 @@ plugins: extra: analytics: provider: custom - property: https://two-torial.goatcounter.com/count + property: https://tuah-torial.goatcounter.com/count