mirror of
https://github.com/aljazceru/midnight-gh-pages-theme.git
synced 2025-12-17 06:04:20 +01:00
Add head-custom.html to allow easier customization of the <head>
This commit is contained in:
10
_includes/head-custom-google-analytics.html
Normal file
10
_includes/head-custom-google-analytics.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% if site.google_analytics %}
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
{% endif %}
|
||||
@@ -1,9 +1,12 @@
|
||||
<!-- start custom head snippets -->
|
||||
<!-- start custom head snippets, customize with your own _includes/head-custom.html file -->
|
||||
|
||||
<!-- Setup theme-color. -->
|
||||
<!-- Setup theme-color -->
|
||||
{% include head-custom-theme-colors.html %}
|
||||
|
||||
<!-- You can set your favicon here. -->
|
||||
<!-- Setup Google Analytics -->
|
||||
{% include head-custom-google-analytics.html %}
|
||||
|
||||
<!-- You can set your favicon here -->
|
||||
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->
|
||||
|
||||
<!-- end custom head snippets -->
|
||||
|
||||
@@ -47,16 +47,5 @@
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
{% if site.google_analytics %}
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user