Changeset 15443 in project


Ignore:
Timestamp:
08/13/09 19:16:45 (10 years ago)
Author:
sjamaan
Message:

Add quick and dirty index file handling

File:
1 edited

Legend:

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

    r15442 r15443  
    102102  (make-pathname (qwiki-source-path) (string-join path "/")))
    103103
     104;; Handle index files where needed.  Never try to open a directory as file
     105(define (normalize-path path)
     106  (if (directory? (path->source-filename path))
     107      (append path '("index"))
     108      path))
     109
    104110;; Like with-output-to-file, only this creates parent directories as needed.
    105111(define (with-output-to-path path thunk)
     
    133139                       '()))
    134140         (source (or (alist-ref 'source postdata)
    135                      (and (file-exists? source-file) ;; XXX what if it's a dir?
     141                     (and (file-exists? source-file)
    136142                          (with-input-from-file source-file read-string))
    137143                     ""))
     
    282288                        (alist-ref 'action (uri-query uri) eq? "show")))
    283289               (handler (alist-ref action action-handlers eq? qwiki-show)))
    284           (handler (relative-uri-path uri) (current-request))))))
     290          (handler (normalize-path (relative-uri-path uri))
     291                   (current-request))))))
    285292
    286293(define (qwiki-render-file file)
Note: See TracChangeset for help on using the changeset viewer.