Move style to pages

Evgeny PisemskyThu Sep 05 17:25:36+0300 2024

25e4048

Move style to pages

gitile/handler.scm

8484
                (asset-load-data a))
8585
        (not-found request footer))))
8686
87-
(define (style page project ref footer)
88-
  `(html
89-
     (head
90-
       (meta (@ (charset "UTF-8")))
91-
       (meta (@ (name "viewport") (content "width=device-width, initial-scale=1")))
92-
       (link (@ (rel "stylesheet") (href "/css/gitile.css")))
93-
       (link (@ (rel "stylesheet") (href "/css/highlight.css")))
94-
       (link (@ (rel "icon") (href "/images/icon.png") (sizes "32x32")))
95-
       (script (@ (src "/js/gitile.js")) "")
96-
       (title ,project))
97-
     (body
98-
       (header
99-
         (nav
100-
           (ul
101-
             (li (@ (class "first")) (a (@ (href "/")) "Projects"))
102-
             (li (a (@ (href "/" ,project)) "Repository"))
103-
             (li (a (@ (href "/" ,project "/tree/" ,ref)) "Files"))
104-
             (li (a (@ (href "/" ,project "/commits")) "Commits"))
105-
             (li (a (@ (href "/" ,project "/tags")) "Tags")))))
106-
       (div (@ (id "content"))
107-
            ,@page)
108-
       (footer ,@footer))))
109-
11087
(define-record-type <project>
11188
  (make-project slug name description)
11289
  project?

gitile/pages.scm

3838
            project-index
3939
            project-commits
4040
            project-commit
41-
            project-tags))
41+
            project-tags
42+
            style))
4243
4344
(define* (project-file-raw repo path #:key (ref "-"))
4445
  (let* ((ref (if (equal? ref "-") #f ref))

336337
               (loop lines (+ old-line 1) (+ new-line 1))))))
337338
        0))
338339
    (append content (cons file-header `((table (@ (class "file-diff")) ,file-content))))))
340+
341+
(define (style page project ref footer)
342+
  `(html
343+
     (head
344+
       (meta (@ (charset "UTF-8")))
345+
       (meta (@ (name "viewport") (content "width=device-width, initial-scale=1")))
346+
       (link (@ (rel "stylesheet") (href "/css/gitile.css")))
347+
       (link (@ (rel "stylesheet") (href "/css/highlight.css")))
348+
       (link (@ (rel "icon") (href "/images/icon.png") (sizes "32x32")))
349+
       (script (@ (src "/js/gitile.js")) "")
350+
       (title ,project))
351+
     (body
352+
       (header
353+
         (nav
354+
           (ul
355+
             (li (@ (class "first")) (a (@ (href "/")) "Projects"))
356+
             (li (a (@ (href "/" ,project)) "Repository"))
357+
             (li (a (@ (href "/" ,project "/tree/" ,ref)) "Files"))
358+
             (li (a (@ (href "/" ,project "/commits")) "Commits"))
359+
             (li (a (@ (href "/" ,project "/tags")) "Tags")))))
360+
       (div (@ (id "content"))
361+
            ,@page)
362+
       (footer ,@footer))))