add favicon

master
Dirk Heilig 2024-02-12 18:42:58 +01:00
parent ce64a3121f
commit e63c154bdb
5 changed files with 5 additions and 1 deletions

BIN
static/img/fav.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -4,6 +4,7 @@
<meta name="gitdate" content="{{ .Page.GitInfo.CommitDate }}">
<meta name="gitmsg" content="{{ .Page.GitInfo.Subject }}">
<meta name="buildtime" content="{{ time.Now }}">
<link rel="icon" type="image/png" href="{{ "img/fav.png" | relURL }}">
{{ $title := .Site.Title -}}
{{ if .Params.Title -}}
{{ $title = printf "%s | %s" .Params.Title $title -}}
@ -76,7 +77,6 @@
{{ end }}
<link rel="shortcut icon" href="{{ "images/favicon.ico" | relURL }}" type="image/x-icon" />
<style>
body{
background-color: #202124;

View File

@ -6,12 +6,16 @@ document.addEventListener("DOMContentLoaded", function () {
})
.then(function (data) {
let body=document.getElementsByTagName("body")[0];
let fav=document.querySelector("head link[rel='icon']");
if (data.state.open) {
body.classList.remove("door_closed");
body.classList.add("door_open");
fav.setAttribute("href", "img/favopen.png")
} else {
body.classList.remove("door_open");
body.classList.add("door_closed");
fav.setAttribute("href", "img/favclosed.png")
}
document
.getElementById("ds-img")