diff --git a/Makefile b/Makefile
index bf14831c3e932d95f3ee33af555885a1ffe126c7..bd7d016ebd52fe2cb834d19008208934681bd059 100644
--- a/Makefile
+++ b/Makefile
@@ -74,5 +74,3 @@ -exec gci write -s standard -s default -s "prefix(git.sr.ht/~gabrielgio/img)" {} +
alignment:
betteralign -apply ./...
-
-bootstrap:
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 1591102b51c5ac723daf3b980f721f078b4f954c..b940145af604f507d5625e711765dfb3c27dd86e 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -72,7 +72,7 @@ panic("failed to decode key database: " + err.Error())
}
r := router.New()
- r.GET("/static/{filepath:*}", ext.FileServer(static.Static, "static/"))
+ r.GET("/static/{filepath:*}", ext.FileServer(static.Static))
// repository
var (
diff --git a/pkg/ext/fileserver.go b/pkg/ext/fileserver.go
index ee4a80b1127e7f7cb6d5d1124931b7f2d65b7b9b..87c1ae8f2d507f8c1d69832d741e24a2c76daeca 100644
--- a/pkg/ext/fileserver.go
+++ b/pkg/ext/fileserver.go
@@ -15,11 +15,11 @@
// This is a VERY simple file server. It does not take a lot into consideration
// and it should only be used to return small predictable files, like in the
// static folder.
-func FileServer(rootFS FileSystem, rootPath string) fasthttp.RequestHandler {
+func FileServer(rootFS FileSystem) fasthttp.RequestHandler {
return func(ctx *fasthttp.RequestCtx) {
path := ctx.UserValue("filepath").(string)
- f, err := rootFS.Open(rootPath + path)
+ f, err := rootFS.Open(path)
if err != nil {
InternalServerError(ctx, err)
return
diff --git a/scss/main.scss b/scss/main.scss
index 7028622f93c495f755a63365a8093ba4cc8c1264..89d209699c14cbfb185cf0556a0805c3814ebd82 100644
--- a/scss/main.scss
+++ b/scss/main.scss
@@ -64,6 +64,11 @@ margin: 5px;
}
+.card-image {
+ margin: 5px;
+}
+
+
.image.is-fit {
height: auto;
width: 130px;
diff --git a/templates/media.qtpl b/templates/media.qtpl
index 65b39c426344118fbbe8e1336ddb02c5e36e8e77..18eac0df9a08dcd92a8ab70ac012eb459c8f43f8 100644
--- a/templates/media.qtpl
+++ b/templates/media.qtpl
@@ -14,7 +14,7 @@ <div class="columns is-multiline">
{% for _, media := range p.Medias %}
<div class="card-image">
{% if media.IsVideo() %}
- <video controls muted="true" poster="/media/thumbnail?path_hash={%s media.PathHash %}" preload="none">
+ <video class="image is-fit" controls muted="true" poster="/media/thumbnail?path_hash={%s media.PathHash %}" preload="metadata">
<source src="/media/image?path_hash={%s media.PathHash %}" type="{%s media.MIMEType %}">
</video>
{% else %}