Added Ko-Fi floating button for support

This commit is contained in:
Pablo Marcos 2022-02-17 17:01:46 +01:00
parent cec34fbb8d
commit 6dafe4efd4
3 changed files with 25 additions and 0 deletions

View file

@ -12,6 +12,8 @@
<!--================= add analytics if enabled =========================-->
{{- partial "analytics.html" . -}}
</head>
<body data-spy="scroll" data-target="#TableOfContents" data-offset="80">
<div class="container-fluid bg-dimmed wrapper">
<!----- ADD NAVBAR --------------->
@ -36,5 +38,9 @@
<!------- ADD PAGE SPECIFIC SCRIPTS ------>
{{ block "scripts" . }} {{ end }}
<!------ IF WANTED, ADD SUPPORT LINKS -------->
{{- partial "misc/support.html" . -}}
</body>
</html>

View file

@ -79,5 +79,9 @@
<script src="{{ "/js/github-button.js" | relURL }}"></script>
<script src="{{ "/js/home.js" | relURL }}"></script>
<script src="{{ "/js/jquery.filterizr.min.js" | relURL }}"></script>
<!------ IF WANTED, ADD SUPPORT LINKS -------->
{{- partial "misc/support.html" . -}}
</body>
</html>

View file

@ -0,0 +1,15 @@
{{ 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>
{{ end }}
{{ end }}