Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
1db81615
authored
May 29, 2024
by
Carson Yang
Committed by
GitHub
May 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: add umami analytics (#1626)
Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
parent
1e48922b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
docSite/hugo.toml
+5
-0
docSite/layouts/partials/docs/analytics/umami.html
+17
-0
docSite/layouts/partials/docs/head.html
+6
-0
No files found.
docSite/hugo.toml
View file @
1db81615
...
@@ -156,6 +156,11 @@ defaultContentLanguage = 'zh-cn'
...
@@ -156,6 +156,11 @@ defaultContentLanguage = 'zh-cn'
# ["Something else"]
# ["Something else"]
# ]
# ]
[params.umamiAnalytics]
websiteid
=
"69b3f2c6-39a5-4937-b92d-6fdd5c8f5958"
domain
=
"umami.fastgpt.in"
scriptName
=
"fastgpt"
[menu]
[menu]
[[menu.primary]]
[[menu.primary]]
name
=
"Docs"
name
=
"Docs"
...
...
docSite/layouts/partials/docs/analytics/umami.html
0 → 100644
View file @
1db81615
{{ if isset site.Params.umamiAnalytics "domain" }}
<script
data-id=
"umami-script"
async
src=
"https://{{ site.Params.umamiAnalytics.domain }}/{{ site.Params.umamiAnalytics.scriptName }}"
data-website-id=
"{{ site.Params.umamiAnalytics.websiteid }}"
>
</script>
{{ else }}
<script
data-id=
"umami-script"
async
src=
"https://analytics.umami.is/script.js"
data-website-id=
"{{ site.Params.umamiAnalytics.websiteid }}"
>
</script>
{{ end }}
<script
type=
"text/javascript"
>
document
.
querySelector
(
'script[data-id="umami-script"]'
).
addEventListener
(
'load'
,
function
()
{
const
type
=
document
.
head
.
querySelector
(
'meta[property = "og:type"]'
).
getAttribute
(
'content'
);
let
title
=
document
.
head
.
querySelector
(
'meta[property = "og:title"]'
).
getAttribute
(
'content'
);
let
url
=
document
.
head
.
querySelector
(
'meta[property = "og:url"]'
).
getAttribute
(
'content'
);
umami
.
track
(
type
+
':'
+
title
,
{
'url'
:
url
});
});
</script>
\ No newline at end of file
docSite/layouts/partials/docs/head.html
View file @
1db81615
...
@@ -106,6 +106,11 @@
...
@@ -106,6 +106,11 @@
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
<!-- change -->
<!-- change -->
{{- if not .Site.IsServer }}
{{ with site.Params.umamiAnalytics.websiteid }}
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "analytics/umami.html") . -}}
{{ end }}
{{ end }}
<link
rel=
"preload"
href=
"https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css"
as=
"style"
/>
<link
rel=
"preload"
href=
"https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css"
as=
"style"
/>
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css"
/>
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css"
/>
</head>
</head>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment