aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/js.html18
-rw-r--r--layouts/partials/meta.html2
2 files changed, 9 insertions, 11 deletions
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
index 8465483..d966643 100644
--- a/layouts/partials/js.html
+++ b/layouts/partials/js.html
@@ -3,11 +3,11 @@
* Dev toolset
*/
- console.log('cState v4.4 - https://github.com/cstate/cstate');
+ console.log('cState v5 Dev - https://github.com/cstate/cstate');
document.getElementsByTagName('html')[0].className = 'js';
/**
- * Make theme color pretty
+ * Change header color based on status
*/
if (document.body.className === 'change-header-color') {
@@ -43,6 +43,7 @@
/**
* Returns a relative date string for the given date.
*/
+
function timeSince(date) {
var seconds = Math.floor((new Date() - date) / 1000);
@@ -78,6 +79,7 @@
* Changes elements with the class 'relative-time' into relative times and
* moves the timestamp to a title attribute tooltip.
*/
+
function updateRelativeTimes() {
var elements = document.querySelectorAll('.relative-time');
for (var i = 0; i < elements.length; i++) {
@@ -95,21 +97,17 @@
element.innerHTML = html.trim();
}
}
+
updateRelativeTimes();
- setInterval(updateRelativeTimes, 5000);
- /**
- * Reload homepage after 290 seconds.
- */
- if (document.querySelector('body.status-homepage')) {
- setTimeout(location.reload, 290000)
- }
+ // Update "time since" feature every 5s
+ setInterval(updateRelativeTimes, 5000);
</script>
{{ if ne .Site.Params.googleAnalytics "UA-00000000-1" }}
<!-- Global site tag (gtag.js) - Google Analytics -->
- <script type="text/javascript" defer src="https://www.googletagmanager.com/gtag/js?id=UA-109775664-1"></script>
+ <script type="text/javascript" defer src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.googleAnalytics }}"></script>
<script type="text/javascript" defer>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html
index 77c66db..283e840 100644
--- a/layouts/partials/meta.html
+++ b/layouts/partials/meta.html
@@ -12,7 +12,7 @@
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
- <meta name="generator" content="cState v4.4 - https://github.com/cstate/cstate">
+ <meta name="generator" content="cState v5 Dev - https://github.com/cstate/cstate">
<meta name="theme-color" content="{{ .Site.Params.brand }}">
<script>
var themeBrandColor = '{{ .Site.Params.brand }}';