DATARAMA

Render classes for metadata

April 25, 2016
Project: plutonium

…replacing the text headers, we now do CSS classes.

1 files changed, 7 insertions / 7 deletions

diff --git a/plutonium.scm b/plutonium.scm
index a3d4b81..399972e 100755
--- a/plutonium.scm
+++ b/plutonium.scm
@@ -287,9 +287,9 @@
   `(li (a (@ (href ,(string-append (uri-encode-string rel) ".html"))) 
           ,(page-title (string-append rel "." extension)))))
 
-(define (render-metadata content)
+(define (render-metadata class content)
   (if content
-    `(div ,content)
+    `(div (@ (class ,class)) ,content)
     ""))
 
 ; == Site Archive =============================================================
@@ -415,7 +415,7 @@
 
 (page-element author
   VWCODE
-  (render-metadata ELEMENT))
+  (render-metadata "author" ELEMENT))
 
 (page-element pageclass
   (string-append "page_" (irregex-replace 
@@ -426,21 +426,21 @@
 
 (page-element date
   (if VWCODE (string->date VWCODE date-format/file) #f)
-  (render-metadata (date->string ELEMENT date-format/html)))
+  (render-metadata "date" (date->string ELEMENT date-format/html)))
 
 (page-element focus
   VWCODE
   (let ((links (map string-trim-both (string-split ELEMENT ","))))
-    (render-metadata 
+    (render-metadata "focus"
       `(ul ,(map focuslink links)))))
 
 (page-element rating
   (and VWCODE (string->number VWCODE))
-  (render-metadata (rating->stars ELEMENT)))
+  (render-metadata "rating" (rating->stars ELEMENT)))
 
 (page-element related
   (and (assoc NAME ramap) (sort (cdr (assoc NAME ramap)) string<?))
-  (render-metadata 
+  (render-metadata "related"
     (and (not (null? ELEMENT)) `(ul ,(map rel->link ELEMENT)))))
 
 (define (focuslink lnk)
 
Powered by Plutonium