Skip to content

Commit

Permalink
new hugo version wants new way to mix go and js
Browse files Browse the repository at this point in the history
idky!
  • Loading branch information
SallyMcGrath committed Jan 24, 2024
1 parent 660d3e8 commit 1ee1923
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion website/layouts/partials/random-bg.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

<script>
function randomBG() {
const baseUrl = "{{.Site.BaseURL}}";
const neon = "{{ range $neons }}{{ .Name }}{{ end }}";
const quad = "{{ range $quads }}{{ .Name }}{{ end }}";
const style = document.createElement("style");
style.textContent = `body, html {background-image:url("{{.Site.BaseURL}}pictures/svgs/neons/{{ range $neons }}{{ .Name }}{{ end }}"),url("{{.Site.BaseURL}}pictures/svgs/quads/{{ range $quads }}{{ .Name }}{{ end }}"),radial-gradient(circle,var(--theme-color--paper) 0%,var(--theme-color--block) 50%,var(--theme-color--paper) 100%);
style.textContent = `body, html {background-image:url("${baseUrl}pictures/svgs/neons/${neon}"),url("${baseUrl}pictures/svgs/quads/${quad}"),radial-gradient(circle,var(--theme-color--paper) 0%,var(--theme-color--block) 50%,var(--theme-color--paper) 100%);
background-size: cover;
}`;

Expand Down

0 comments on commit 1ee1923

Please sign in to comment.