fix: fix path of assets

This commit is contained in:
Simon Vieille 2025-08-31 11:26:57 +02:00
commit 689abf2ca7
Signed by: deblan
GPG key ID: 579388D585F70417
3 changed files with 7 additions and 7 deletions

View file

@ -17,7 +17,7 @@ var (
func entrypointFiles(app, category string) []string {
if entrypoints == nil {
value, _ := statics.ReadFile("static/entrypoints.json")
value, _ := statics.ReadFile("dist/entrypoints.json")
json.Unmarshal(value, &entrypoints)
}
@ -38,7 +38,7 @@ func entrypointFiles(app, category string) []string {
func Asset(name string) string {
if manifest == nil {
value, _ := statics.ReadFile("static/manifest.json")
value, _ := statics.ReadFile("dist/manifest.json")
json.Unmarshal(value, &manifest)
}

View file

@ -36,10 +36,10 @@ func main() {
e := echo.New()
e.Validator = &AppValidator{validator: validator.New()}
e.Static("/static", "static")
e.Static("/dist", "dist")
assetHandler := http.FileServer(rice.MustFindBox("../../assets/dist").HTTPBox())
e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", assetHandler)))
e.GET("/dist/*", echo.WrapHandler(http.StripPrefix("/dist/", assetHandler)))
e.Use(middleware.Logger())
router.RegisterControllers(e)

View file

@ -42,9 +42,9 @@ func (ctrl *Controller) Messages(c echo.Context) error {
msg.WebhookMessage.User.DisplayColor,
))
originIcon = Img(Src(assets.Asset("static/img/owncast.png")), Class("message-origin"))
originIcon = Img(Src(assets.Asset("dist/img/owncast.png")), Class("message-origin"))
case store.MessageOriginTwitch:
originIcon = Img(Src(assets.Asset("static/img/twitch.png")), Class("message-origin"))
originIcon = Img(Src(assets.Asset("dist/img/twitch.png")), Class("message-origin"))
}
return Div(
@ -68,7 +68,7 @@ func (ctrl *Controller) Messages(c echo.Context) error {
Language: "fr",
Head: []Node{
Group(assets.EntrypointCss("main")),
Link(Rel("icon"), Type("image/x-icon"), Href(assets.Asset("static/img/favicon.png"))),
Link(Rel("icon"), Type("image/x-icon"), Href(assets.Asset("dist/img/favicon.png"))),
},
Body: []Node{
ID("chat"),