added matomo

This commit is contained in:
Nick Yeoman 2026-01-09 12:41:55 -08:00
parent 0d91b61bd0
commit 81c239f043
3 changed files with 20 additions and 1 deletions

View File

@ -10,6 +10,7 @@ $config = [
'base_url' => 'http://localhost:8000',
'secure_key' => '', //64 alphanumeric characters
'logfile' => '/logs/novaconium.log',
'loglevel' => 'ERROR', // 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'NONE'
'loglevel' => 'ERROR', // 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'NONE',
'matomo' => '1',
'fonts' => 'https://fonts.googleapis.com/css2?family=VT323:wght@400&family=Fira+Code:wght@400;500&display=swap&family=Material+Icons:wght@400;500&display=swap'
];

View File

@ -17,6 +17,7 @@ $log = new Logger(\BASEPATH . $config['logfile'], $config['loglevel']);
// --- Twig Data Array ---
$data = [];
$data['fonts'] = $config['fonts'] ?? [];
$data['matomo'] = $config['matomo'] ?? 0;
// --- Session ---
use Novaconium\Session;

View File

@ -9,3 +9,20 @@
{% if editor == 'ace' %}
{% include '@novaconium/javascript/ace.html.twig' %}
{% endif %}
{% if matomo > 0 %}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = "//matomo.4lt.ca/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', {{ matomo }}]);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
{% endif %}