Refactor analytics code + Add local fonts
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
parent
1fd13371ad
commit
be2c2c6810
78 changed files with 81 additions and 62 deletions
|
@ -80,7 +80,7 @@
|
|||
<script src="{{ "/js/home.js" | relURL }}"></script>
|
||||
<script src="{{ "/js/jquery.filterizr.min.js" | relURL }}"></script>
|
||||
|
||||
<!------ IF WANTED, ADD SUPPORT LINKS -------->
|
||||
<!------ ADD SUPPORT LINKS -------->
|
||||
{{- partial "misc/support.html" . -}}
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,33 +1,46 @@
|
|||
<!-- Add Analytics if enabled in configuration -->
|
||||
{{ if eq site.Params.Features.analytics.enable true }}
|
||||
{{ with site.Params.features.analytics }}
|
||||
{{ if .enabled }}
|
||||
<!-- Google Analytics -->
|
||||
{{ with .google }}
|
||||
{{ $privacyConfig:= dict (slice "Site" "Config" "Privacy" "GoogleAnalytics") $.Site.Config.Privacy.GoogleAnalytics }}
|
||||
{{ $analyticsConfig := dict (slice "Site" "GoogleAnalytics") .id }}
|
||||
{{ template "_internal/google_analytics.html" (merge $privacyConfig $analyticsConfig) }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Google Analytics -->
|
||||
{{ if site.Params.Features.analytics.Google }}
|
||||
<!-- Google Analytics v3 ID -->
|
||||
{{ if hasPrefix site.Params.Features.analytics.Google "UA-"}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
<!-- Google Analytics v4 ID -->
|
||||
{{ else }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
<!-- Counter.dev -->
|
||||
{{ with .counterDev }}
|
||||
<script>
|
||||
if (
|
||||
!sessionStorage.getItem("_swa") &&
|
||||
document.referrer.indexOf(location.protocol + "//" + location.host) !== 0
|
||||
) {
|
||||
fetch(
|
||||
"https://counter.dev/track?" +
|
||||
new URLSearchParams({
|
||||
referrer: document.referrer,
|
||||
screen: screen.width + "x" + screen.height,
|
||||
user: "{{ .id }}",
|
||||
utcoffset: "1",
|
||||
})
|
||||
);
|
||||
}
|
||||
sessionStorage.setItem("_swa", "1");
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
<!-- GoatCounter -->
|
||||
{{ with .goatCounter }}
|
||||
<script
|
||||
data-goatcounter="https://{{ .code }}.goatcounter.com/count"
|
||||
async
|
||||
src="//gc.zgo.at/count.js"
|
||||
></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Counter.dev -->
|
||||
{{ if site.Params.Features.analytics.CounterDev }}
|
||||
<script>if(!sessionStorage.getItem("_swa")&&document.referrer.indexOf(location.protocol+"//"+location.host)!== 0){fetch("https://counter.dev/track?"+new URLSearchParams({referrer:document.referrer,screen:screen.width+"x"+screen.height,user:"{{ site.Params.Features.analytics.CounterDev }}",utcoffset:"1"}))};sessionStorage.setItem("_swa","1");</script>
|
||||
{{ end }}
|
||||
|
||||
<!-- Counter.dev -->
|
||||
{{ if site.Params.Features.analytics.GoatCounter }}
|
||||
<script data-goatcounter="https://{{ site.Params.Features.analytics.GoatCounter }}.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
<!-- Keep backwards compatibility and consistency with HUGO defaults -->
|
||||
{{ else if site.GoogleAnalytics }}
|
||||
{{ if hasPrefix site.GoogleAnalytics "UA-"}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ else }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ if site.GoogleAnalytics }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -8,11 +8,12 @@
|
|||
<link rel="stylesheet" href="{{ "/css/navigators/navbar.css" | relURL }}"/>
|
||||
<link rel="stylesheet" href="{{ "/css/plyr.css" | relURL }}"/>
|
||||
<link rel="stylesheet" href="{{ "/css/flag-icon.min.css" | relURL }}"/>
|
||||
<link rel="stylesheet" href="{{ "/css/google-fonts.css" | relURL }}">
|
||||
|
||||
<!--=================== cdn ==============================-->
|
||||
<!-- Font Awesome cant be easily converted because the CSS file auto-references the website (../) -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />
|
||||
<!--=================== fonts ==============================-->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Muli:wght@300;400;500;600">
|
||||
|
||||
<!--=================== icons ==============================-->
|
||||
<link rel="stylesheet" href="{{ "/fontawesome/css/all.min.css" | relURL }}"/>
|
||||
|
||||
<!--================= fab-icon =========================-->
|
||||
{{/* add favicon only if the site author has provided the the favicon */}}
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
<link rel="stylesheet" href="{{ "/css/katex.min.css" | relURL }}">
|
||||
<script type="text/javascript" defer src="{{ "/js/katex.min.js" | relURL }}"></script>
|
||||
<script type="text/javascript" defer src="{{ "/js/auto-render.min.js" | relURL }}" onload="renderMathInElement(document.body);"></script>
|
||||
|
||||
<script>
|
||||
renderMathInElement(
|
||||
document.body,
|
||||
{
|
||||
delimiters: [
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "\\[", right: "\\]", display: true},
|
||||
{left: "$", right: "$", display: false},
|
||||
{left: "\\(", right: "\\)", display: false}
|
||||
]
|
||||
}
|
||||
);
|
||||
<link rel="stylesheet" href="{{ "/katex/katex.min.css" | relURL }}">
|
||||
<script type="text/javascript" defer src="{{ "/katex/katex.min.js" | relURL }}"></script>
|
||||
<script type="text/javascript" defer src="{{ "/katex/auto-render.min.js" | relURL }}" onload="renderMathInElement(document.body);">
|
||||
renderMathInElement(
|
||||
document.body,
|
||||
{
|
||||
delimiters: [
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "\\[", right: "\\]", display: true},
|
||||
{left: "$", right: "$", display: false},
|
||||
{left: "\\(", right: "\\)", display: false}
|
||||
]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
{{ if eq site.Params.Features.Support.enable true }}
|
||||
|
||||
<!-- Enable Ko-Fi floating button -->
|
||||
{{ if site.Params.Features.Support.KoFi }}
|
||||
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
|
||||
<script>
|
||||
kofiWidgetOverlay.draw('{{ site.Params.Features.Support.KoFi.user }}', {
|
||||
'type': 'floating-chat',
|
||||
'floating-chat.donateButton.text': '{{ site.Params.Features.Support.KoFi.text }}',
|
||||
'floating-chat.donateButton.background-color': '{{ site.Params.Features.Support.KoFi.backgroundcolor }}',
|
||||
'floating-chat.donateButton.text-color': '{{ site.Params.Features.Support.KoFi.textcolor }}'
|
||||
});
|
||||
</script>
|
||||
{{ with site.Params.features.support }}
|
||||
{{ if .enabled }}
|
||||
<!-- Enable Ko-Fi floating button -->
|
||||
{{ with .kofi }}
|
||||
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
|
||||
<script>
|
||||
kofiWidgetOverlay.draw('{{ .user }}', {
|
||||
'type': 'floating-chat',
|
||||
'floating-chat.donateButton.text': '{{ .text }}',
|
||||
'floating-chat.donateButton.text-color': '{{ .textColor }}',
|
||||
'floating-chat.donateButton.background-color': '{{ .backgroundColor }}',
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
6
static/fontawesome/css/all.min.css
vendored
Normal file
6
static/fontawesome/css/all.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
static/fontawesome/webfonts/fa-brands-400.ttf
Normal file
BIN
static/fontawesome/webfonts/fa-brands-400.ttf
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-brands-400.woff2
Normal file
BIN
static/fontawesome/webfonts/fa-brands-400.woff2
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-regular-400.ttf
Normal file
BIN
static/fontawesome/webfonts/fa-regular-400.ttf
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-regular-400.woff2
Normal file
BIN
static/fontawesome/webfonts/fa-regular-400.woff2
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-solid-900.ttf
Normal file
BIN
static/fontawesome/webfonts/fa-solid-900.ttf
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-solid-900.woff2
Normal file
BIN
static/fontawesome/webfonts/fa-solid-900.woff2
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-v4compatibility.ttf
Normal file
BIN
static/fontawesome/webfonts/fa-v4compatibility.ttf
Normal file
Binary file not shown.
BIN
static/fontawesome/webfonts/fa-v4compatibility.woff2
Normal file
BIN
static/fontawesome/webfonts/fa-v4compatibility.woff2
Normal file
Binary file not shown.
1
static/js/katex.min.js
vendored
1
static/js/katex.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
static/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
static/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
BIN
static/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Bold.woff
Normal file
BIN
static/katex/fonts/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
BIN
static/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Italic.woff
Normal file
BIN
static/katex/fonts/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
BIN
static/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Math-Italic.woff
Normal file
BIN
static/katex/fonts/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Script-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
BIN
static/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
BIN
static/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
Binary file not shown.
BIN
static/katex/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
BIN
static/katex/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
1
static/katex/katex.min.js
vendored
Normal file
1
static/katex/katex.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue