Changeset 18701 in project


Ignore:
Timestamp:
07/04/10 18:52:44 (10 years ago)
Author:
sjamaan
Message:

qwiki: Allow a global wiki title to be set which will automatically be applied to all pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/qwiki/trunk/qwiki.scm

    r18634 r18701  
    5757   qwiki-clear-cache!
    5858   qwiki-css-file
     59   qwiki-title
    5960   qwiki-sxml-page-template
    6061   send-content
     
    108109(define qwiki-css-file
    109110  (make-parameter #f (lambda (x) (and x (uri-reference x)))))
     111
     112(define qwiki-title (make-parameter #f))
    110113
    111114(define blocked-ip-addresses-file
     
    140143    . ,alist-conv-rules*))
    141144
     145(define wiki-add-title
     146  `((Header
     147     ((title . ,(lambda (tag elems)
     148                  (if (not (qwiki-title))
     149                      (cons tag elems)
     150                      (cons tag `(,@elems " - " ,(qwiki-title)))))))
     151     . ,(lambda (tag elems)
     152          (cons tag elems)))
     153    . ,alist-conv-rules*))
     154
    142155;; The rules used for transforming page SXML structure
    143156(define (qwiki-transformation-steps content)
    144   (append (list wiki-link-normalization)
     157  (append (list wiki-link-normalization wiki-add-title)
    145158          (qwiki-extensions)
    146159          ((qwiki-output-driver) content)
Note: See TracChangeset for help on using the changeset viewer.