From 52fdb0fd511ca1d65047e860198749f158997ac9 Mon Sep 17 00:00:00 2001 From: perennial Date: Fri, 25 Oct 2024 19:32:09 +1100 Subject: [PATCH] tag search by popular, experimental update frontend for popular search add PIXIVFE_POPULAR_SEARCH_ENABLED option --- .env.example | 5 +- assets/views/tag.jet.html | 40 ++++---- config/config.go | 12 +++ core/artwork.go | 23 ++--- core/endpoints.go | 50 +++++++++- core/popular_search.go | 138 +++++++++++++++++++++++++++ core/tag.go | 34 +++++++ doc/hosting/environment-variables.md | 15 +++ i18n/locale/en/code.json | 1 + i18n/locale/en/template.json | 7 ++ server/routes/tag.go | 24 ++--- server/routes/types.go | 23 ++--- 12 files changed, 320 insertions(+), 52 deletions(-) create mode 100644 core/popular_search.go diff --git a/.env.example b/.env.example index f88ca3b..c807ad9 100644 --- a/.env.example +++ b/.env.example @@ -29,7 +29,10 @@ PIXIVFE_HOST='127.0.0.1' # PIXIVFE_CACHE_ENABLED= # PIXIVFE_CACHE_SIZE= # PIXIVFE_CACHE_TTL= -# PIXIVFE_CACHE_SHORT_TTL +# PIXIVFE_CACHE_SHORT_TTL= + +### Feature configuration +# PIXIVFE_POPULAR_SEARCH_ENABLED= ### Development options # PIXIVFE_DEV= diff --git a/assets/views/tag.jet.html b/assets/views/tag.jet.html index 9deb344..71468be 100644 --- a/assets/views/tag.jet.html +++ b/assets/views/tag.jet.html @@ -166,10 +166,30 @@