Changeset 18147 in project


Ignore:
Timestamp:
05/22/10 01:55:40 (9 years ago)
Author:
Moritz Heidkamp
Message:

generate correct target paths during compilation preparation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/hyde/hyde.scm

    r18137 r18147  
    108108      (error (format "error executing ~A ~A" name (string-intersperse args))))))
    109109
    110 (define (make-output-path path)
    111   (make-pathname (output-dir) (pathname-relative-from (source-dir) path)))
     110(define (make-output-path path #!optional page-vars)
     111  (let ((output-file (make-pathname (output-dir) (pathname-relative-from (source-dir) path))))
     112    (if page-vars
     113        (pathname-replace-extension output-file (->string (or (alist-ref 'ext page-vars) (default-extension))))
     114        output-file)))
    112115
    113116(define (call-with-returning value proc)
     
    140143
    141144(define (write-to-target-file-for source-file contents)
    142   (let* ((target-file (make-output-path source-file))
    143          (target-ext  (->string (or (alist-ref 'ext (page-vars)) (default-extension))))
    144          (target-file (pathname-replace-extension target-file target-ext)))
     145  (let* ((target-file (make-output-path source-file (page-vars))))
    145146
    146147    (with-output-to-file target-file
     
    168169
    169170(define (load-page-vars file)
    170   (pages (cons (list (pathname-relative-from (source-dir) file)
    171                      (pathname-relative-from (output-dir) (make-output-path file))
    172                      (with-input-from-file file read)) (pages))))
     171  (let ((page-vars (with-input-from-file file read)))
     172   (pages (cons (list (pathname-relative-from (source-dir) file)
     173                      (make-pathname "/" (pathname-relative-from (output-dir) (make-output-path file page-vars)))
     174                      page-vars) (pages)))))
    173175
    174176(define (compile-page source-file)
Note: See TracChangeset for help on using the changeset viewer.