diff options
author | Jonas Kohl | 2024-07-20 14:43:51 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-07-20 14:43:51 +0200 |
commit | 1686a64bf3ee21363f0139c05c55fabf8620e4a1 (patch) | |
tree | 54c37bb446753144827fd66ec3faa5b508b088df | |
parent | 7a5339a3629e141dc576b20f2b0baabe6d336fb3 (diff) |
Add favicon (support)
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | dev-server.php | 7 | ||||
-rw-r--r-- | src/favicon.ico | bin | 0 -> 1150 bytes |
3 files changed, 12 insertions, 1 deletions
@@ -5,7 +5,11 @@ DEV_SERVER_BINDING?=127.0.0.1:19310 .PHONY: build/static publish dev-server -all: $(HTMLTARGETS) $(STATICFILES) build/static +all: $(HTMLTARGETS) $(STATICFILES) build/static build/favicon.ico + +build/favicon.ico: src/favicon.ico + cp src/favicon.ico build/ + build/static: rsync -rupE src/static build/ diff --git a/dev-server.php b/dev-server.php index 0577fdd..2e5aacb 100644 --- a/dev-server.php +++ b/dev-server.php @@ -32,6 +32,13 @@ elseif (str_ends_with($name, ".html")) { http_response_code(302); header("Location: /$name"); exit; +} elseif ($name === "favicon.ico" && is_file(SRCDIR . "/favicon.ico")) { + $path = SRCDIR . "/favicon.ico"; + $len = filesize($path); + header("Content-Type: image/x-icon"); + header("Content-Length: $len"); + readfile($path); + exit; } $include_file = FALLBACK_FILE; diff --git a/src/favicon.ico b/src/favicon.ico Binary files differnew file mode 100644 index 0000000..65332b1 --- /dev/null +++ b/src/favicon.ico |