Skip to content

Commit

Permalink
feat: add favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
bomgar committed Sep 28, 2024
1 parent 035190d commit 3d00431
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/base_page.templ
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ templ BasePage() {
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap" rel="stylesheet"/>
<link rel="icon" href="/static/favicon.webp"/>
<style type="text/css">
:root {
--color-rosewater: #f5e0dc;
Expand Down
6 changes: 6 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server

import (
"embed"
"encoding/json"
"fmt"
"log/slog"
Expand All @@ -12,6 +13,9 @@ import (
"github.com/brocode/neoweb/nvimwrapper"
)

//go:embed static
var staticFs embed.FS

func Run() {

nvimWrapper, err := nvimwrapper.Spawn()
Expand All @@ -36,6 +40,8 @@ func Run() {

mux := http.NewServeMux()

mux.Handle("GET /static/", http.FileServer(http.FS(staticFs)))

mux.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) {
result, err := nvimWrapper.Render()
if err != nil {
Expand Down
Binary file added server/static/favicon.webp
Binary file not shown.

0 comments on commit 3d00431

Please sign in to comment.