summaryrefslogtreecommitdiff
path: root/internal/web/profile.go
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/web/profile.go
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/web/profile.go')
-rw-r--r--internal/web/profile.go35
1 files changed, 33 insertions, 2 deletions
diff --git a/internal/web/profile.go b/internal/web/profile.go
index 52d918b48..e8483921d 100644
--- a/internal/web/profile.go
+++ b/internal/web/profile.go
@@ -142,11 +142,22 @@ func (m *Module) prepareProfile(c *gin.Context) *profile {
}
}
+ // Limit varies depending on whether this is a gallery view or not.
+ // If gallery view, we want a nice full screen of media, else we
+ // don't want to overwhelm the viewer with a shitload of posts.
+ var limit int
+ if account.WebLayout == "gallery" {
+ limit = 40
+ } else {
+ limit = 20
+ }
+
// Get statuses from maxStatusID onwards (or from top if empty string).
statusResp, errWithCode := m.processor.Account().WebStatusesGet(
ctx,
account.ID,
mediaOnly,
+ limit,
maxStatusID,
)
if errWithCode != nil {
@@ -230,7 +241,17 @@ func (m *Module) profileMicroblog(c *gin.Context, p *profile) {
Instance: p.instance,
OGMeta: apiutil.OGBase(p.instance).WithAccount(p.account),
Stylesheets: stylesheets,
- Javascript: []string{jsFrontend},
+ Javascript: []apiutil.JavascriptEntry{
+ {
+ Src: jsFrontend,
+ Async: true,
+ Defer: true,
+ },
+ {
+ Bottom: true,
+ Src: jsBlurhash,
+ },
+ },
Extra: map[string]any{
"account": p.account,
"rssFeed": p.rssFeed,
@@ -294,7 +315,17 @@ func (m *Module) profileGallery(c *gin.Context, p *profile) {
Instance: p.instance,
OGMeta: apiutil.OGBase(p.instance).WithAccount(p.account),
Stylesheets: stylesheets,
- Javascript: []string{jsFrontend},
+ Javascript: []apiutil.JavascriptEntry{
+ {
+ Src: jsFrontend,
+ Async: true,
+ Defer: true,
+ },
+ {
+ Bottom: true,
+ Src: jsBlurhash,
+ },
+ },
Extra: map[string]any{
"account": p.account,
"rssFeed": p.rssFeed,