mirror of
https://github.com/aljazceru/hacker-gh-pages-theme.git
synced 2025-12-17 06:04:21 +01:00
Add Plausible Analytics support
- Add plausible configuration option in _config.yml - Create head-custom-plausible-analytics.html include file - Update head-custom.html to include Plausible Analytics - Support for self-hosted Plausible via plausible_script_url option Users can now configure Plausible Analytics similarly to Google Analytics: - Set plausible: yourdomain.com in _config.yml - Optionally set plausible_script_url for self-hosted instances
This commit is contained in:
@@ -2,4 +2,6 @@ title: Hacker theme
|
|||||||
description: Hacker is a theme for GitHub Pages.
|
description: Hacker is a theme for GitHub Pages.
|
||||||
show_downloads: true
|
show_downloads: true
|
||||||
google_analytics:
|
google_analytics:
|
||||||
|
plausible:
|
||||||
|
# plausible_script_url: https://plausible.io/js/script.js # Optional: for self-hosted Plausible instances
|
||||||
theme: jekyll-theme-hacker
|
theme: jekyll-theme-hacker
|
||||||
4
_includes/head-custom-plausible-analytics.html
Normal file
4
_includes/head-custom-plausible-analytics.html
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{% if site.plausible %}
|
||||||
|
<!-- Plausible Analytics -->
|
||||||
|
<script defer data-domain="{{ site.plausible }}" src="{% if site.plausible_script_url %}{{ site.plausible_script_url }}{% else %}https://plausible.io/js/script.js{% endif %}"></script>
|
||||||
|
{% endif %}
|
||||||
@@ -6,6 +6,9 @@
|
|||||||
<!-- Setup Google Analytics -->
|
<!-- Setup Google Analytics -->
|
||||||
{% include head-custom-google-analytics.html %}
|
{% include head-custom-google-analytics.html %}
|
||||||
|
|
||||||
|
<!-- Setup Plausible Analytics -->
|
||||||
|
{% include head-custom-plausible-analytics.html %}
|
||||||
|
|
||||||
<!-- You can set your favicon here -->
|
<!-- You can set your favicon here -->
|
||||||
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->
|
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user