summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-03-31 15:51:17 +0200
committerLibravatar GitHub <noreply@github.com>2025-03-31 15:51:17 +0200
commit3949117be01ac8aca7e41a7179506f27627654e5 (patch)
treece5c30ca299a57af69284d58021cc9380cdc553f /internal/api
parent[docs] Fix Swagger URL for the "edit status" operation (#3932) (diff)
downloadgotosocial-3949117be01ac8aca7e41a7179506f27627654e5.tar.xz
[feature] Use blurhashes in frontend, tidy up gallery view a bit (#3948)
* [feature] Use blurhashes in frontend, tidy up gallery view a bit * weeeeeeeeeeeeeeeee * beep boop
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/util/template.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/internal/api/util/template.go b/internal/api/util/template.go
index ec04a4d97..38e79484f 100644
--- a/internal/api/util/template.go
+++ b/internal/api/util/template.go
@@ -48,10 +48,10 @@ type WebPage struct {
// Can be nil.
Stylesheets []string
- // Paths to JS files to add to
- // the page as "script" entries.
+ // JS files to add to the
+ // page as "script" entries.
// Can be nil.
- Javascript []string
+ Javascript []JavascriptEntry
// Extra parameters to pass to
// the template for rendering,
@@ -60,6 +60,21 @@ type WebPage struct {
Extra map[string]any
}
+type JavascriptEntry struct {
+ // Insert <script> tag at the end
+ // of <body> rather than in <head>.
+ Bottom bool
+
+ // Path to the js file.
+ Src string
+
+ // Use async="" attribute.
+ Async bool
+
+ // Use defer="" attribute.
+ Defer bool
+}
+
// TemplateWebPage renders the given HTML template and
// page params within the standard GtS "page" template.
//