Skip to content
Snippets Groups Projects
Commit ae3126bd authored by mathias.chouet's avatar mathias.chouet
Browse files

Restore matomo tracking in docs

parent 66f5b62a
No related branches found
No related tags found
No related merge requests found
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['disableCookies']); // évite de mettre en place un bandeau RGPD
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stasi.g-eau.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
\ No newline at end of file
'use strict';
/**
* copies Mathjax to src/assets/docs/javascripts after doc was built by MkDocs
* copies extra javascripts (MathJax, matomo-tracking) to src/assets/docs/javascripts after doc was built by MkDocs
*/
const fs = require('fs-extra');
const destPath = "src/assets/docs/javascripts/mathjax";
const destPath = "src/assets/docs/javascripts";
const destPathMJ = destPath + "/mathjax";
// empty destination folder
fs.emptyDirSync(destPath);
// create destination subfolders
fs.ensureDirSync(destPath + "/fonts/HTML-CSS/TeX/", { recursive: true });
fs.ensureDirSync(destPathMJ + "/fonts/HTML-CSS/TeX/", { recursive: true });
// copy required files only
fs.copySync("node_modules/mathjax/MathJax.js", destPath + "/MathJax.js");
fs.copySync("node_modules/mathjax/config", destPath + "/config");
fs.copySync("node_modules/mathjax/jax", destPath + "/jax");
fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/woff", destPath + "/fonts/HTML-CSS/TeX/woff");
fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/otf", destPath + "/fonts/HTML-CSS/TeX/otf");
fs.copySync("node_modules/mathjax/MathJax.js", destPathMJ + "/MathJax.js");
fs.copySync("node_modules/mathjax/config", destPathMJ + "/config");
fs.copySync("node_modules/mathjax/jax", destPathMJ + "/jax");
fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/woff", destPathMJ + "/fonts/HTML-CSS/TeX/woff");
fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/otf", destPathMJ + "/fonts/HTML-CSS/TeX/otf");
fs.copySync("docs/matomo-tracking.js", destPath + "/matomo-tracking.js");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment