diff --git a/handlers/handler.go b/handlers/handler.go index f2a902f..e19b3c3 100644 --- a/handlers/handler.go +++ b/handlers/handler.go @@ -5,10 +5,10 @@ import ( "net/http" "github.com/a-h/templ" + gorillaHandlers "github.com/gorilla/handlers" "github.com/gorilla/mux" "github.com/rramiachraf/dumb/views" "github.com/sirupsen/logrus" - gorillaHandlers "github.com/gorilla/handlers" ) func New(logger *logrus.Logger) *mux.Router { @@ -18,6 +18,9 @@ func New(logger *logrus.Logger) *mux.Router { r.Use(gorillaHandlers.CompressHandler) r.Handle("/", templ.Handler(views.HomePage())) + r.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("User-agent: *\nDisallow: /\n")) + }) r.HandleFunc("/albums/{artist}/{albumName}", album(logger)).Methods("GET") r.HandleFunc("/images/{filename}.{ext}", imageProxy(logger)).Methods("GET") r.HandleFunc("/search", search(logger)).Methods("GET") diff --git a/views/album.templ b/views/album.templ index 5e61a04..3cb49fe 100644 --- a/views/album.templ +++ b/views/album.templ @@ -9,7 +9,7 @@ templ AlbumPage(a data.Album) { @layout(fmt.Sprintf("%s - %s", a.Artist, a.Name)) {
- + Album image

{ a.Artist }

{ a.Name }

diff --git a/views/head.templ b/views/head.templ index f82ffd1..b8a5d26 100644 --- a/views/head.templ +++ b/views/head.templ @@ -8,5 +8,6 @@ templ head(title string) { + } diff --git a/views/layout.templ b/views/layout.templ index b02da33..d505ecf 100644 --- a/views/layout.templ +++ b/views/layout.templ @@ -2,7 +2,7 @@ package views templ layout(title string) { - + @head(title)
diff --git a/views/lyrics.templ b/views/lyrics.templ index d03256b..6fd35e2 100644 --- a/views/lyrics.templ +++ b/views/lyrics.templ @@ -9,7 +9,11 @@ templ LyricsPage(s data.Song) { @layout(fmt.Sprintf("%s - %s lyrics", s.Artist, s.Title)) {
- + Song image

{ s.Artist }

{ s.Title }

@@ -41,7 +45,12 @@ templ LyricsPage(s data.Song) {

{ s.Album.Name }

- + Album image
} diff --git a/views/navbar.templ b/views/navbar.templ index 502ba8b..a8b6d4e 100644 --- a/views/navbar.templ +++ b/views/navbar.templ @@ -3,7 +3,7 @@ package views templ navbar() {