Skip to content

Commit

Permalink
add favicon + webpage title
Browse files Browse the repository at this point in the history
  • Loading branch information
raphi011 committed Nov 26, 2024
1 parent d8ec66e commit e3048fc
Show file tree
Hide file tree
Showing 15 changed files with 1,397 additions and 945 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Handoff
# 🤝 Handoff

Handoff is a library that allows you to bootstrap a server that runs scheduled and manually triggered e2e tests written in Go and is extensible through plugins.

Expand Down
3 changes: 3 additions & 0 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/julienschmidt/httprouter"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/raphi011/handoff/internal/html"
"github.com/raphi011/handoff/internal/html/assets"
"github.com/raphi011/handoff/internal/model"
"github.com/yuin/goldmark"
)
Expand Down Expand Up @@ -52,6 +53,8 @@ func (s *Server) runHTTP() error {
router.POST("/schedules/:schedule-name", s.createSchedule)
router.DELETE("/schedules/:schedule-name", s.deleteSchedule)

router.ServeFiles("/assets/*filepath", http.FS(assets.Assets))

s.httpServer = &http.Server{
Handler: router,
// TODO: set reasonable timeouts
Expand Down
8 changes: 8 additions & 0 deletions internal/html/assets/embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package assets

import (
"embed"
)

//go:embed *
var Assets embed.FS
Binary file added internal/html/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion internal/html/body.templ
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package html

templ body() {
templ body(title string) {
<!DOCTYPE html>
<html class="h-full bg-white">
<head>
<meta charset="UTF-8"/>
<title>Handoff { title }</title>
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon.png" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="h-full">
Expand Down
307 changes: 261 additions & 46 deletions internal/html/body_templ.go

Large diffs are not rendered by default.

114 changes: 79 additions & 35 deletions internal/html/component/heading_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 73 additions & 25 deletions internal/html/component/stats_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e3048fc

Please sign in to comment.