Changeset 20543 in project


Ignore:
Timestamp:
09/27/10 17:12:27 (10 years ago)
Author:
Moritz Heidkamp
Message:

gazette: add dates and authors to archive and reverse its ordering; fix a bug in the default-page-vars regexp for issue layouts

Location:
gazette
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • gazette/hyde.scm

    r20447 r20543  
    11(use hyde hyde-atom environments)
    22
    3 (default-page-vars '(((: bos "issues/" (+ any) ".wiki")
     3(default-page-vars '(((: bos "/issues/" (+ any) ".html")
    44                      (layouts "article.sxml" "default.sxml"))))
    55
     
    1919  (time->string (seconds->utc-time seconds) "%Y-%m-%d %z"))
    2020
     21(define (authors->sxml authors)
     22  `(,(car authors)
     23    ,@(if (null? (cdr authors))
     24          '()
     25          (map (lambda (author)
     26                 `(,(car author) (span (@ (class "author")) ,(cdr author))))
     27               (append (map (cut cons ", " <>) (butlast (cdr authors)))
     28                       `((" and " . ,(last authors))))))))
     29
    2130(for-each (lambda (binding)
    2231            (apply environment-extend! (cons (page-eval-env) binding)))
    2332          `((page-updated ,page-updated)
    2433            (format-seconds ,format-seconds)
     34            (authors->sxml ,authors->sxml)
    2535            (all-issues ,(lambda ()
    2636                           (sort-by (pages-matching "issues/.+") page-updated)))))
  • gazette/layouts/article.sxml

    r20060 r20543  
    11()
    22`((h1 ,($ 'title))
    3 
    43  (div (@ (class "article-meta"))
    5        (p (@ (class "authors"))
    6           "by "
    7           ,(car ($ 'authors))
    8           ,@(if (null? (cdr ($ 'authors)))
    9                 '()
    10                 (map (lambda (author)
    11                        `(,(car author) (span (@ (class "author")) ,(cdr author))))
    12                      (append (map (cut cons ", " <>) (butlast (cdr ($ 'authors))))
    13                              `((" and " . ,(last ($ 'authors))))))))
    14        (p  (@ (class "date")) ,(format-seconds ($ 'date))))
     4       (p (@ (class "authors")) "by " ,(authors->sxml ($ 'authors)))
     5       (p (@ (class "date")) ,(format-seconds ($ 'date))))
    156
    167  (inject ,contents)
  • gazette/src/archive.sxml

    r20060 r20543  
    11((title . "Archive"))
    22`(h1 ,($ 'title))
    3 `(dl ,(map (lambda (issue)
    4              `((dt (a (@ (href ,(page-path issue))) ,($ 'title issue)))
    5                (dd ,(format-seconds ($ 'date issue)))))
    6            (reverse (all-issues))))
     3`(dl (@ (id "archive"))
     4     ,(map (lambda (issue)
     5             `((dt (a (@ (href ,(page-path issue))) ,($ 'title issue))
     6                   " "
     7                   (span (@ (class "date")) ,(format-seconds ($ 'date issue))))
     8               (dd (@ (class "authors"))
     9                   "by " ,(authors->sxml ($ 'authors issue)))))
     10           (all-issues)))
  • gazette/src/gazette.scss

    r20060 r20543  
    2121    (margin-bottom "7em"))
    2222
     23   ((// |#archive|)
     24    ((// .date)
     25     (font-weight "normal")
     26     (margin-top ".5em")))
     27
    2328   ((// ul.links)
    2429    (text-align "right")
Note: See TracChangeset for help on using the changeset viewer.