Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ social:

# Analytics
analytics:
provider : plausible # false (default), "google", "google-universal", "custom", "plausible"
provider : google # false (default), "google", "google-universal", "custom", "plausible"
google:
tracking_id : ""
tracking_id : "G-0ZPVV6GNEY"
plausible:
domain : "camilo-cf.github.io"
api_host : "https://plausible.io"
Expand Down
31 changes: 20 additions & 11 deletions _includes/analytics-providers/google.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.analytics.google.tracking_id }}']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- Google Analytics 4 (GA4) -->
<!-- Note: When consent banner is enabled, consent.js handles GA4 loading after user consent -->
{% if site.analytics.google.tracking_id %}
{% unless site.consent_banner.enabled %}
<!-- Consent banner disabled: Load GA4 directly -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.tracking_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.analytics.google.tracking_id }}');
</script>
{% else %}
<!-- Consent banner enabled: Setup handled by consent.js -->
<script>
window.dataLayer = window.dataLayer || [];
window.gtag = window.gtag || function(){dataLayer.push(arguments);};
</script>
{% endunless %}
{% endif %}
29 changes: 21 additions & 8 deletions _includes/head/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<!-- start custom head snippets -->

<!-- Security Headers -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://www.googletagmanager.com https://cdnjs.cloudflare.com https://giscus.app https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; connect-src 'self' https://www.google-analytics.com https://giscus.app https://api.github.com; frame-src https://giscus.app; font-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'self';">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin">
<meta http-equiv="Permissions-Policy" content="geolocation=(), microphone=(), camera=(), payment=(), usb=(), magnetometer=(), gyroscope=(), accelerometer=()">

<link rel="apple-touch-icon" sizes="57x57" href="{{ base_path }}/images/apple-touch-icon-57x57.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="60x60" href="{{ base_path }}/images/apple-touch-icon-60x60.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="72x72" href="{{ base_path }}/images/apple-touch-icon-72x72.png?v=M44lzPylqQ">
Expand All @@ -24,15 +30,22 @@
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="{{ base_path }}/assets/css/academicons.css"/>

<script type="text/x-mathjax-config"> MathJax.Hub.Config({ TeX: { equationNumbers: { autoNumber: "all" } } }); </script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
<!-- MathJax 3 Configuration -->
<script>
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$'], ['\\[', '\\]']],
processEscapes: true,
tags: 'ams'
},
options: {
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
integrity="sha256-3Fdoa0sH4Qndroe1Y6nAUOervFPNCvFhUcHfCKN69sQ="
crossorigin="anonymous"></script>

<!-- end custom head snippets -->