Hi team, Thanks for your help.
@Chris After all the modifications that I've made according to your comments, I've created the latest version of my patch. Could you please review the patch attached and share your ideas? Please note that a few parts are left. After your confirmation, I can handle it shortly. Patch name: 0001-Set-a-more-informative-page-title-for-any-page On Tue, Apr 13, 2021 at 8:51 PM Maxime Devos <maximede...@telenet.be> wrote: > > On Tue, 2021-04-13 at 18:56 +0300, Canan Talayhan wrote: > > [...] > > After sending the patch I've turned the patch like below. > > (title ,(if title > > `,(string-append title " - Guix Data Service") > > '("Guix Data Service"))) > > A little more simplification is possible: > > `,(string-append title ...) --> (string-append ...) > > The code `,A after macro-expansion simply becomes A, for every A. > To test, you can run > ,expand `,(string-append title " something") > in a Guile REPL. > > Also, > '("Guix Data Service"))) > seems incorrect. The end result if title is #f would be > (title ("Guix Data Service")), > while I believe you wanted > (title "Guix Data Service"). > > Correct code would be > > > (title ,(if title > > `,(string-append title " - Guix Data Service") > > "Guix Data Service")) > or alternatively > > > (title ,(if title > > `,(string-append title " - Guix Data Service") > > '"Guix Data Service")) > or > > (title ,(if title > > `,(string-append title " - Guix Data Service") > > `"Guix Data Service")) > > I don't know how familiar you are with quasiquote (`), quote (') and > unquote (,); it may be worthwhile to look this up in the Guile maual > > `,(string-append title " - Guix Data Service") > > I recommend sending e-mails as plain text. One benefit is that plain > text doesn't mess up code indentation (at least on e-mail clients using > fixed-width fonts for plain text, which seems standard). > > Greetings, > Maxime.
commit f1a85cdf2beecdc3d01b1242088182e9a3a2af11 Author: Canan Talayhan <canan.t.talay...@gmail.com> Date: Thu Apr 8 17:29:37 2021 +0300 Set a more informative page title for any page where the title is "Guix Data Service" --- guix-data-service/web/build/html.scm | 6 ++- guix-data-service/web/dumps/html.scm | 6 ++- guix-data-service/web/jobs/html.scm | 25 +++++++++-- guix-data-service/web/nar/html.scm | 6 ++- guix-data-service/web/package/html.scm | 6 ++- guix-data-service/web/revision/html.scm | 73 +++++++++++++++++++++++++++++++-- guix-data-service/web/view/html.scm | 12 ++++-- 7 files changed, 119 insertions(+), 15 deletions(-) diff --git a/guix-data-service/web/build/html.scm b/guix-data-service/web/build/html.scm index 18d045a..4b758bb 100644 --- a/guix-data-service/web/build/html.scm +++ b/guix-data-service/web/build/html.scm @@ -29,7 +29,11 @@ valid-targets stats builds) + (define page-header "Builds") + (layout + #:title + page-header #:body `(,(header) (div @@ -38,7 +42,7 @@ (@ (class "row")) (div (@ (class "col-sm-12")) - (h1 "Builds") + (h1 ,page-header) (table (@ (class "table")) (thead diff --git a/guix-data-service/web/dumps/html.scm b/guix-data-service/web/dumps/html.scm index 71e69c8..c35cc1e 100644 --- a/guix-data-service/web/dumps/html.scm +++ b/guix-data-service/web/dumps/html.scm @@ -21,8 +21,12 @@ #:use-module (guix-data-service web view html) #:export (view-dumps)) +(define page-header "Dumps") + (define (view-dumps available-dumps) (layout + #:title + page-header #:body `(,(header) (div @@ -31,7 +35,7 @@ (@ (class "row")) (div (@ (class "col-sm-12")) - (h1 "Database dumps"))) + (h1 ,page-header))) ,@(map (match-lambda ((date-string . files) diff --git a/guix-data-service/web/jobs/html.scm b/guix-data-service/web/jobs/html.scm index 82734d6..54f6aaf 100644 --- a/guix-data-service/web/jobs/html.scm +++ b/guix-data-service/web/jobs/html.scm @@ -30,7 +30,11 @@ jobs-and-events recent-events show-next-page?) + (define page-header "Jobs") + (layout + #:title + page-header #:body `(,(header) (div @@ -40,7 +44,7 @@ (div (@ (class "col-sm-12")) (h1 (@ (style "display: inline-block;")) - "Jobs") + ,page-header) (div (@ (class "btn-group pull-right") (style "margin-top: 1.3rem;") @@ -189,7 +193,11 @@ (define (view-job-events query-parameters recent-events) + (define page-header "Recent Events") + (layout + #:title + page-header #:body `(,(header) (div @@ -200,7 +208,7 @@ (@ (class "col-sm-12")) (a (@ (href "/jobs")) (h3 "Jobs")) - (h1 "Recent events"))) + (h1 ,page-header))) (div (@ (class "row")) (div @@ -256,7 +264,11 @@ recent-events))))))))) (define (view-job-queue jobs-and-events) + (define page-header "Queued Jobs") + (layout + #:title + page-header #:body `(,(header) (div @@ -267,7 +279,7 @@ (@ (class "col-sm-12")) (a (@ (href "/jobs")) (h3 "Jobs")) - (h1 "Queued jobs (" + (h1 ,page-header"(" ,(length jobs-and-events) ")"))) (div @@ -329,8 +341,13 @@ '()))))) jobs-and-events))))))))) + (define (view-job job-id query-parameters log) + (define page-header "Job") + (layout + #:title + (string-append page-header " " job-id) #:body `(,(header) (div @@ -339,7 +356,7 @@ (@ (class "row")) (div (@ (class "col-sm-12")) - (h1 "Job " ,job-id))) + (h1 ,page-header ," " ,job-id))) (div (@ (class "row")) (div diff --git a/guix-data-service/web/nar/html.scm b/guix-data-service/web/nar/html.scm index 596d16b..07e6c47 100644 --- a/guix-data-service/web/nar/html.scm +++ b/guix-data-service/web/nar/html.scm @@ -21,8 +21,12 @@ #:use-module (guix-data-service web view html) #:export (view-substitutes)) +(define page-header "Substitutes") + (define (view-substitutes narinfo-signing-public-key) (layout + #:title + page-header #:body `(,(header) (div @@ -31,7 +35,7 @@ (@ (class "row")) (div (@ (class "col-sm-12")) - (h1 "Substitutes") + (h1 ,page-header) ,@(if (canonical-sexp? narinfo-signing-public-key) `((h3 "Public key") (pre diff --git a/guix-data-service/web/package/html.scm b/guix-data-service/web/package/html.scm index 0d9b078..af4552e 100644 --- a/guix-data-service/web/package/html.scm +++ b/guix-data-service/web/package/html.scm @@ -24,7 +24,11 @@ #:export (view-package)) (define* (view-package name package-version-with-branches) + (define page-header "Package") + (layout + #:title + (string-append page-header " " name) #:body `(,(header) (div @@ -33,7 +37,7 @@ (@ (class "row")) (div (@ (class "col-md-12")) - (h1 "Package: " ,name))) + (h1 ,page-header ," " ,name))) ,@(map (match-lambda ((('version . version) diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm index 25b79f4..0685523 100644 --- a/guix-data-service/web/revision/html.scm +++ b/guix-data-service/web/revision/html.scm @@ -48,7 +48,11 @@ (define* (view-revision-news commit-hash query-parameters news-entries) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take commit-hash 7) " Channel News Entries") #:body `(,(header) (div @@ -59,7 +63,7 @@ (@ (class "col-sm-12")) (h3 (a (@ (style "white-space: nowrap;") (href ,(string-append "/revision/" commit-hash))) - "Revision " (samp ,commit-hash))))) + ,page-header " " (samp ,commit-hash))))) (div (@ (class "row")) (div @@ -107,7 +111,11 @@ #:key path-base header-text header-link) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take(string-drop header-link 10)7) " Package " name) #:body `(,(header) (div @@ -135,7 +143,7 @@ branch-name)))) branches))) git-repositories-and-branches) - (h1 "Package " ,name))) + (h1 ,"Package " ,name))) (div (@ (class "row")) (div @@ -169,7 +177,11 @@ #:key header-text header-link version-history-link) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take(string-drop header-link 10)7) " Package" " " name " @" version) #:body `(,(header) (div @@ -224,7 +236,7 @@ (role "button")) "Version history")) '()) - (h1 "Package " ,name " @ " ,version))) + (h1 ,page-header ," " ,name " @ " ,version))) (div (@ (class "row")) (div @@ -471,7 +483,11 @@ lint-warning-counts #:key (path-base "/revision/") header-text) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take commit-hash 7)) #:body `(,(header) (div @@ -547,7 +563,11 @@ '("Version" "Synopsis" "Description" "Home page" "Location" "Licenses"))) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Packages") #:body `(,(header) (div @@ -755,7 +775,11 @@ total-package-descriptions))))) package-description-counts)) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Packages Translation Availability") #:body `(,(header) (div @@ -835,7 +859,11 @@ query-parameters #:key (path-base "/revision/") header-text header-link) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " System Tests") #:body `(,(header) (div @@ -936,7 +964,11 @@ channel-instances #:key (path-base "/revision/") header-text header-link) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Channel Instances") #:body `(,(header) (div @@ -1216,7 +1248,11 @@ figure { data-percentages colours)))))) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take revision-commit-hash 7) " Package Substitute Availability") #:body `(,(header) (style ,chart-css) @@ -1254,7 +1290,11 @@ figure { #:key (path-base "/revision/") header-text header-link) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Package Reproducibility") #:body `(,(header) (style " @@ -1521,7 +1561,11 @@ figure { (define fields (assq-ref query-parameters 'field)) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Package Derivations") #:body `(,(header) (div @@ -1702,7 +1746,11 @@ figure { ;;("Unknown" . "unknown") TODO )) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Fixed Output Package Derivations") #:body `(,(header) (div @@ -1842,7 +1890,11 @@ figure { (cons url id))) build-server-urls)) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Package Derivation Outputs") #:body `(,(header) (div @@ -2021,7 +2073,11 @@ figure { build-server-options stats builds) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take commit-hash 7) " Builds") #:body `(,(header) (div @@ -2158,7 +2214,11 @@ figure { (string-downcase field)))) '("Linter" "Message" "Location"))) + (define page-header "Revision") + (layout + #:title + (string-append page-header " " (string-take (string-drop header-link 10) 7) " Lint Warnings") #:body `(,(header) (div @@ -2314,7 +2374,11 @@ figure { (define (unknown-revision commit-hash job git-repositories-and-branches jobs-and-events) + (define page-header "Unknown Revision") + (layout + #:title + page-header #:body `(,(header) (div @@ -2353,7 +2417,10 @@ figure { (define (unprocessed-revision commit-hash job git-repositories-and-branches jobs-and-events) + (define page-header "Unprocessed Revision") (layout + #:title + page-header #:body `(,(header) (div diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 8063e17..33535a9 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -65,13 +65,15 @@ (define* (layout #:key (head '()) (body '()) - (title "Guix Data Service") + title description) `((doctype "html") (html (@ (lang "en")) (head - (title ,title) + (title ,(if title + (string-append title " — Guix Data Service") + "Guix Data Service")) (meta (@ (http-equiv "Content-Type") (content "text/html; charset=UTF-8"))) (meta (@ (name "viewport") @@ -286,8 +288,7 @@ (define (index git-repositories-and-revisions) (layout #:description - "The Guix Data Service processes, stores and provides data about Guix over -time." + "The Guix Data Service processes, stores and provides data about Guix over time." #:body `(,(header) (div @@ -334,7 +335,10 @@ time." git-repositories-and-revisions))))) (define (view-statistics guix-revisions-count derivations-count) + (define page-header "Statistics") (layout + #:title + page-header #:body `(,(header) (div