Index: add newest works

This commit is contained in:
VnPower
2024-11-06 20:46:51 +07:00
parent c239bc1e5d
commit 227dd249e1
2 changed files with 22 additions and 3 deletions
+19
View File
@@ -75,6 +75,16 @@
</div>
</div>
</div>
<hr class="border-neutral-700 opacity-100 rounded mb-0">
<div class="col-12 mt-3">
<h2>Newest works</h2>
<div class="row row-cols-2 row-cols-md-4 row-cols-lg-6 g-4">
{{- include "fragments/small-tn" .Data.Newest }}
</div>
</div>
{{- else }}
<!-- Otherwise, the user is logged in, show the full landing page -->
@@ -178,6 +188,15 @@
</div>
{{- end }}
<hr class="border-neutral-700 opacity-100 rounded mb-0">
<div class="col-12 mt-3">
<h2>Newest works</h2>
<div class="row row-cols-2 row-cols-md-4 row-cols-lg-6 g-4">
{{- include "fragments/small-tn" .Data.Newest }}
</div>
</div>
{{- end }}
</div>
{{- end }}
+3 -3
View File
@@ -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
}