Initial commit
This commit is contained in:
commit
e92e33b10b
6 changed files with 71 additions and 0 deletions
20
LICENSE
Normal file
20
LICENSE
Normal file
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 YOUR_NAME_HERE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2
i18n/en.yaml
Normal file
2
i18n/en.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
trackingStatus:
|
||||
other: Tracking Status
|
2
i18n/pt.yaml
Normal file
2
i18n/pt.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
trackingStatus:
|
||||
other: Estado da monitorização
|
29
layouts/partials/matomo_head.html
Normal file
29
layouts/partials/matomo_head.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
{{ if and (isset .Site.Params "matomo") (eq .Site.Params.matomo.enable true) }}
|
||||
<!-- Matomo -->
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
{{ if and (isset .Site.Params.matomo "disablecookies") (eq .Site.Params.matomo.disablecookies true) }}
|
||||
_paq.push(['disableCookies']);
|
||||
{{ end }}
|
||||
{{ if or (not (isset .Site.Params.matomo "requirecookieconsent")) (eq .Site.Params.matomo.requirecookieconsent true) }}
|
||||
_paq.push(['requireCookieConsent']);
|
||||
{{ end }}
|
||||
{{ if and (isset .Site.Params.matomo "heartbeat") (eq .Site.Params.matomo.heartbeat true) }}
|
||||
_paq.push(['enableHeartBeatTimer']);
|
||||
{{ end }}
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="{{- .Site.Params.matomo.url -}}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{- .Site.Params.matomo.id -}}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
{{ if and (isset .Site.Params.matomo "noscript") (eq .Site.Params.matomo.noscript true) }}
|
||||
<noscript><p><img referrerpolicy="no-referrer-when-downgrade" src="{{- .Site.Params.matomo.url -}}/matomo.php?idsite={{- .Site.Params.matomo.id -}}&rec=1" style="border:0;" alt="" /></p></noscript>
|
||||
{{ end }}
|
||||
<!-- End Matomo Code -->
|
||||
{{ end }}
|
6
layouts/shortcodes/matomo_tracking.html
Normal file
6
layouts/shortcodes/matomo_tracking.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
<p><u>{{ i18n "trackingStatus" }}</u></p>
|
||||
<iframe
|
||||
style="border: 0; min-width: 100%; min-height: 200px"
|
||||
src="{{- .Site.Params.matomo.url -}}/index.php?module=CoreAdminHome&action=optOut&language={{ .Site.Language.Lang }}&backgroundColor={{- .Site.Params.matomo.privacy.backgroundcolor -}}&fontColor={{- .Site.Params.matomo.privacy.fontcolor -}}&fontSize={{- .Site.Params.matomo.privacy.fontsize -}}&fontFamily={{- .Site.Params.matomo.privacy.fontfamily -}}"
|
||||
></iframe>
|
12
theme.toml
Normal file
12
theme.toml
Normal file
|
@ -0,0 +1,12 @@
|
|||
name = "Hugo Matomo"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
|
||||
description = "Hugo Theme Component to extend a theme with support for Matomo web application"
|
||||
homepage = "https://www.r3pek.org"
|
||||
tags = ["matomo", "piwik", "analytics", "component"]
|
||||
min_version = "0.41.0"
|
||||
version = "0.1.0"
|
||||
|
||||
[author]
|
||||
name = "Carlos Mogas da Silva"
|
||||
homepage = "https://www.r3pek.org"
|
Loading…
Reference in a new issue