From 227dd249e15569e246e89d0460a56d02694adb5e Mon Sep 17 00:00:00 2001 From: VnPower Date: Wed, 6 Nov 2024 20:46:51 +0700 Subject: [PATCH] Index: add newest works --- assets/views/index.jet.html | 19 +++++++++++++++++++ core/index.go | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/assets/views/index.jet.html b/assets/views/index.jet.html index c7bda07..c7d9d8f 100644 --- a/assets/views/index.jet.html +++ b/assets/views/index.jet.html @@ -75,6 +75,16 @@ + +
+ +
+

Newest works

+
+ {{- include "fragments/small-tn" .Data.Newest }} +
+
+ {{- else }} @@ -178,6 +188,15 @@ {{- end }} +
+ +
+

Newest works

+
+ {{- include "fragments/small-tn" .Data.Newest }} +
+
+ {{- end }} {{- end }} diff --git a/core/index.go b/core/index.go index 5037b6e..6474dd6 100644 --- a/core/index.go +++ b/core/index.go @@ -43,14 +43,13 @@ type LandingArtworks struct { // VnPower: sort alphabetically type Pages struct { - Pixivision []Pixivision `json:"pixivision"` Follow []int `json:"follow"` Recommended RecommendedSection `json:"recommend"` RecommendedByTag []RecommendByTag `json:"recommendByTag"` // Commented out fields that aren't currently implemented in the frontend // EditorRecommended []any `json:"editorRecommend"` - // UserRecommended []any `json:"recommendUser"` + // RecommendedUsers []RecommendedUser `json:"recommendUser"` // Commission []any `json:"completeRequestIds"` // TrendingTag []TrendingTag `json:"trendingTags"` //BoothFollows []BoothFollow `json:"boothFollowItemIds"` @@ -58,7 +57,7 @@ type Pages struct { //ContestResult []Contest `json:"contestResult"` //FavoriteTags []any `json:"myFavoriteTags"` //MyPixiv []any `json:"mypixiv"` - //NewPost []any `json:"newPost"` + Newest []string `json:"newPost"` //"ranking", //"sketchLiveFollowIds", //"sketchLivePopularIds", @@ -152,6 +151,7 @@ func GetLanding(auditor *audit.Auditor, r *http.Request, mode string, isLoggedIn } landing.Rankings, err = ctx.fetchRankings(mode) + landing.Newest = populateArtworks(pages.Newest, artworks) if err != nil { return nil, err }