miniblog

Miniblog: A command-line static blog system in Common Lisp
Log | Files | Refs | README | LICENSE

left-column.lhtml (1269B)


      1 <section id="miniblog-left">
      2   <a href="/">Home</a><br>
      3   <% @if pages %><%
      4     (labels ((descend (parent-path child-path pages)
      5                         (format t "<ul class=\"page-list\">~%")
      6                         (loop for page in (getf pages :children)
      7                               do (let* ((next-name (car child-path))
      8                                         (descendents (cdr child-path))
      9                                         (page-name (getf page :name))
     10                                         (page-path (append parent-path (list page-name)))
     11                                         (page-path-str (str:join "/" page-path)))
     12                                    (format t "<li><a href=\"~apage/~a\">~a</a></li>~%" (getf env :root-uri) page-path-str (getf page :title))
     13                                    (if (string= page-name next-name)
     14                                      (descend page-path descendents page))))
     15                         (format t "</ul>~%")))
     16       (descend nil (getf env :path) (getf env :pages)))
     17   %><% @endif %>
     18   <br>
     19   <% @if links %>
     20     <% @loop links %>
     21       <% @if link %>
     22         <a href="<% @var link %>"><% @var text %></a><br>
     23       <% @else %>
     24         <br>
     25       <% @endif %>
     26     <% @endloop %>
     27   <% @endif %>
     28 </section>