From ec55426077232696ea186417c4290bb41bea4c50 Mon Sep 17 00:00:00 2001 From: blankie Date: Sun, 25 Sep 2022 16:45:07 +0700 Subject: [PATCH] Display real category title Fixes https://lists.sr.ht/~cadence/breezewiki-discuss/%3CCN5B6AUHFUSC.1H7B7SEFDRDK9%40archer%3E --- src/page-category.rkt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/page-category.rkt b/src/page-category.rkt index 8ecd368..f9eb974 100644 --- a/src/page-category.rkt +++ b/src/page-category.rkt @@ -31,7 +31,7 @@ (define (generate-results-page #:source-url source-url #:wikiname wikiname - #:prefixed-category prefixed-category + #:title title #:members-data members-data #:page page #:body-class [body-class #f] @@ -40,13 +40,13 @@ (generate-wiki-page #:source-url source-url #:wikiname wikiname - #:title prefixed-category + #:title title #:body-class body-class #:license license `(div ,(update-tree-wiki page wikiname) (hr) - (h2 ,(format "All Pages in ~a" prefixed-category)) + (h2 ,(format "All Pages in ~a" title)) (div (@ (class "mw-parser-output")) (ul (@ (class "my-category-list")) ,@(map @@ -91,6 +91,7 @@ (easy:response-json dest-res)] [license (license-auto wikiname)]) + (define title (preprocess-html-wiki (jp "/parse/title" page-data prefixed-category))) (define page-html (preprocess-html-wiki (jp "/parse/text" page-data ""))) (define page (html->xexp page-html)) (define head-html (jp "/parse/headhtml" page-data "")) @@ -100,7 +101,7 @@ (define body (generate-results-page #:source-url source-url #:wikiname wikiname - #:prefixed-category prefixed-category + #:title title #:members-data members-data #:page page #:body-class body-class @@ -119,6 +120,6 @@ (generate-results-page #:source-url "" #:wikiname "test" - #:prefixed-category "Category:Items" + #:title "Category:Items" #:members-data category-json-data #:page '(div "page text"))))))