From 59661d3dc2b63fc3a870dc6e824b5441f535f7fd Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Sat, 16 Apr 2011 15:46:12 -0400 Subject: [PATCH] Initial theme/template "hyde" adapted from ckeen and small API updates. --- coleslaw.asd | 5 ++--- src/comments.lisp | 20 ++++++++++---------- src/packages.lisp | 17 +++++++++++++++++ src/posts.lisp | 12 ++++++------ themes/hyde/base.tmpl | 29 +++++++++++++++++++++++++++++ themes/hyde/css/style.css | 31 +++++++++++++++++++++++++++++++ themes/hyde/index.tmpl | 31 +++++++++++++++++++++++++++++++ themes/hyde/post.tmpl | 23 +++++++++++++++++++++++ 8 files changed, 149 insertions(+), 19 deletions(-) create mode 100644 themes/hyde/base.tmpl create mode 100644 themes/hyde/css/style.css create mode 100644 themes/hyde/index.tmpl create mode 100644 themes/hyde/post.tmpl diff --git a/coleslaw.asd b/coleslaw.asd index 0203d79..2284803 100644 --- a/coleslaw.asd +++ b/coleslaw.asd @@ -1,12 +1,11 @@ (defsystem :coleslaw :name "coleslaw-core" :description "Flexible Lisp Blogware" - :version "0.0.1" + :version "0.0.2" :maintainer "Brit Butler " :author "Brit Butler " :licence "LLGPL" - :depends-on (:cl-markdown :docutils - :closure-template :cl-fad) + :depends-on (:cl-markdown :docutils :closure-template :cl-fad) :components ((:module src :components ((:file "packages") (:file "coleslaw" diff --git a/src/comments.lisp b/src/comments.lisp index 67426a8..599d979 100644 --- a/src/comments.lisp +++ b/src/comments.lisp @@ -1,29 +1,29 @@ (in-package :coleslaw) (defclass author () - ((name :initform nil + ((name :initform nil :initarg :name :accessor author-name) - (url :initform nil + (url :initform nil :initarg :url :accessor author-url) - (ip :initform nil + (ip :initform nil :initarg :ip :accessor author-ip))) (defclass comment () - ((id :initform nil + ((id :initform nil :initarg :id :accessor comment-id) - (post :initform nil + (post :initform nil :initarg :post :accessor comment-post) - (author :initform nil + (author :initform nil :initarg :author :accessor comment-author) - (timestamp :initform nil + (timestamp :initform nil :initarg :timestamp :accessor comment-timestamp) - (content :initform nil + (content :initform nil :initarg :content :accessor comment-content) - (parent :initform nil + (parent :initform nil :initarg :parent :accessor comment-parent))) (defgeneric make-comment (post author timestamp content - parent &key &allow-other-key) + parent &key id &allow-other-keys) (:documentation "Create a COMMENT with the given data.")) (defgeneric add-comment (comment post-id) diff --git a/src/packages.lisp b/src/packages.lisp index 1f4b52f..aa23d38 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -22,6 +22,12 @@ #:find-by-date #:find-by-range + #:post-id + #:post-title + #:post-tags + #:post-date + #:post-content + ;; comments #:make-comment #:add-comment @@ -29,6 +35,17 @@ #:render-comments #:find-comments + #:author-name + #:author-url + #:author-ip + + #:comment-id + #:comment-post + #:comment-author + #:comment-timestamp + #:comment-content + #:comment-parent + ;; indices #:add-index #:remove-index diff --git a/src/posts.lisp b/src/posts.lisp index 3d669a8..8e8867a 100644 --- a/src/posts.lisp +++ b/src/posts.lisp @@ -1,18 +1,18 @@ (in-package :coleslaw) (defclass post () - ((id :initform nil + ((id :initform nil :initarg :id :accessor post-id) - (title :initform nil + (title :initform nil :initarg :title :accessor post-title) - (tags :initform nil + (tags :initform nil :initarg :tags :accessor post-tags) - (date :initform nil + (date :initform nil :initarg :date :accessor post-date) - (content :initform nil + (content :initform nil :initarg :content :accessor post-content))) -(defgeneric make-post (title tags date content &key &allow-other-keys) +(defgeneric make-post (title tags date content &key id &allow-other-keys) (:documentation "Create a POST with the given data.")) (defgeneric add-post (post id) diff --git a/themes/hyde/base.tmpl b/themes/hyde/base.tmpl new file mode 100644 index 0000000..8f71deb --- /dev/null +++ b/themes/hyde/base.tmpl @@ -0,0 +1,29 @@ +{namespace coleslaw.theme.hyde} + +{template base} +{\n} + + + {$title} + + + + + + {if $headInject} {$headInject |noAutoescape} {/if} + + + +
+ {$content |noAutoescape} +
+ {if $bodyInject} {$bodyInject |noAutoescape} {/if} +
+ Unless otherwise credited all material {if $license} {$license} {else} © {/if} {$credits} +
+ + +{/template} diff --git a/themes/hyde/css/style.css b/themes/hyde/css/style.css new file mode 100644 index 0000000..2f9c73b --- /dev/null +++ b/themes/hyde/css/style.css @@ -0,0 +1,31 @@ +#content { background: #fff; padding-top: 1em } +#header { float: right; margin-left: 1em; margin-bottom: 1em } +a { text-decoration: none; color: #992900 } +a.anchor { color: black } +.date { font-style: italic } +.title { margin-left: 1em } +.article-meta { margin-left: 2.2em; margin-bottom: 2.2em } +.archive-title { font-size: 1em } .article-title { font-size: 2em } +.article-content { margin-left: 2.2em } +.fineprint { text-align: center; font-size: .9em; margin-top: .5em } +.tag-low { font-size: .8em; font-weight: 200 } +.tag-medium { font-size: 1.2em; font-weight: 600 } +.tag-high { font-size: 1.8em; font-weight: 800 } +.navigation { font-size: 1.2em; border-bottom: 1px solid } +body { background-color: white; font-family: Vollkorn; font-size: 14pt } +.highlight { background-color: (unquote light-yellow) } +.highlight .symbol, .highlight .default, .highlight .comment { background-color: white; font-weight: normal; color: black } +.highlight i { font-style: normal } +.highlight i .symbol { font-weight: bold; color: (unquote red1) } +.highlight .paren1, .highlight .paren2, .highlight .paren3, .highlight .paren4, .highlight .paren5, .highlight .paren6 { background-color: inherit } +.highlight .paren1:hover, .highlight .paren2:hover, .highlight .paren3:hover, .highlight .paren4:hover, .highlight .paren5:hover, .highlight .paren6:hover { font-weight: bold; color: white } +.highlight .string { font-style: italic; font-weight: light; color: #992900 } +.highlight .paren1:hover { background-color: #DB7859 } +.highlight .paren2:hover { background-color: #1B804C } +.highlight .paren3:hover { background-color: #9F214E } +.highlight .paren4:hover { background-color: #DBA059 } +.highlight .paren5:hover { background-color: #B64926 } +.highlight .paren6:hover { background-color: #64A422 } +.highlight .comment { color: (unquote red2) } +pre { overflow: auto; margin-left: 1em; padding: 0.5em; border-left: 1px dashed; background-color: white; padding: .75em .5em; font-family: (unquote mono-font) } +tt { font-size: .9em; font-family: (unquote mono-font) } diff --git a/themes/hyde/index.tmpl b/themes/hyde/index.tmpl new file mode 100644 index 0000000..82c022b --- /dev/null +++ b/themes/hyde/index.tmpl @@ -0,0 +1,31 @@ +{namespace coleslaw.theme.hyde} + +{template index} +{if $taglinks} +
+

This blog covers: {$taglinks |noAutoescape} +

+{/if} +{if $monthlinks} +
+

View blogs from: {$monthlinks |noAutoescape} +

+{/if} +

{$title}

+{foreach $post in $posts} + +{/foreach} +
+ {if $prev} Previous {/if} + {if $next} Next {/if} +
+{/template} diff --git a/themes/hyde/post.tmpl b/themes/hyde/post.tmpl new file mode 100644 index 0000000..ed07ce2 --- /dev/null +++ b/themes/hyde/post.tmpl @@ -0,0 +1,23 @@ +{namespace coleslaw.theme.hyde} + +{template post} +