aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--cmd/server/main.go2
-rw-r--r--pkg/ext/fileserver.go4
-rw-r--r--scss/main.scss5
-rw-r--r--templates/media.qtpl2
5 files changed, 9 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index bf14831..bd7d016 100644
--- a/Makefile
+++ b/Makefile
@@ -74,5 +74,3 @@ gci:
alignment:
betteralign -apply ./...
-
-bootstrap:
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 1591102..b940145 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -72,7 +72,7 @@ func main() {
}
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 ee4a80b..87c1ae8 100644
--- a/pkg/ext/fileserver.go
+++ b/pkg/ext/fileserver.go
@@ -15,11 +15,11 @@ type FileSystem interface {
// 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 7028622..89d2096 100644
--- a/scss/main.scss
+++ b/scss/main.scss
@@ -64,6 +64,11 @@ a.is-danger {
}
+.card-image {
+ margin: 5px;
+}
+
+
.image.is-fit {
height: auto;
width: 130px;
diff --git a/templates/media.qtpl b/templates/media.qtpl
index 65b39c4..18eac0d 100644
--- a/templates/media.qtpl
+++ b/templates/media.qtpl
@@ -14,7 +14,7 @@ type MediaPage struct {
{% 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 %}