Skip to content

Commit c4cae27

Browse files
committed
update banner state on all pages
1 parent c61d7c6 commit c4cae27

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

layouts/_default/single.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
{{ if $showBannerScott}}
88
{{ partial "banner-scott.html" . }}
9+
{{ else }}
10+
{{ partial "banner-none.html" . }}
911
{{ end }}
1012

1113
<article class="my-0">

layouts/partials/banner-none.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script>
2+
3+
function randomString(length) {
4+
let result = '';
5+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
6+
const charactersLength = characters.length;
7+
let counter = 0;
8+
while (counter < length) {
9+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
10+
counter += 1;
11+
}
12+
return result;
13+
}
14+
15+
const requestId = randomString(7);
16+
fetch(`/pulse/log/?banner-none-${requestId}`);
17+
</script>

0 commit comments

Comments
 (0)