1. Joe Bogner
  2. picoblogorg

Commits

Joe Bogner  committed 69875c6

add ability for master page

  • Participants
  • Parent commits 110dacf
  • Branches master

Comments (0)

Files changed (3)

File org-http.l

View file
 
 (de decrypt-string (Str) (crypt-string Str T))
 
+#lots of opportunities for caching here
 (de renderPage (Template Model)
    (let (Html (pack (readLines Template))
-         TemplateTree (parse Html))
+         TemplateTree (parse Html)
+				 Content (renderTree Model TemplateTree)
+				 LayoutHtml (pack (readLines "site.html"))
+				 LayoutTree (parse LayoutHtml))
       (httpHead NIL NIL)
-      (prinl (renderTree Model TemplateTree))))
+      (prinl (renderTree (list 'content Content) LayoutTree))))
 
 (de get-username ()
 	(let (Session (cdr (assoc 'Session *Cookies))

File org.l

View file
 (off *Org-hook-add-heading)
 
 (de org-parse-level (Line)
- (- (length (split (chop Line) "*")) 1))
+	(let Chopped (chop Line)
+		(ifn (= "*" (car Chopped))
+			0
+			(- (length (split Chopped "*")) 1))))
 
 (de org-parse-body (Lines)
   (let Body (collectUntil Lines '((Line) (> (org-parse-level Line) 0)))

File site.html

View file
+<h1>Master!</h1>
+{{content}}
+<h2>footer</h2>