Initial theme/template "hyde" adapted from ckeen and small API updates.
This commit is contained in:
parent
c75ba4bc50
commit
59661d3dc2
8 changed files with 149 additions and 19 deletions
|
@ -1,12 +1,11 @@
|
||||||
(defsystem :coleslaw
|
(defsystem :coleslaw
|
||||||
:name "coleslaw-core"
|
:name "coleslaw-core"
|
||||||
:description "Flexible Lisp Blogware"
|
:description "Flexible Lisp Blogware"
|
||||||
:version "0.0.1"
|
:version "0.0.2"
|
||||||
:maintainer "Brit Butler <redline6561@gmail.com>"
|
:maintainer "Brit Butler <redline6561@gmail.com>"
|
||||||
:author "Brit Butler <redline6561@gmail.com>"
|
:author "Brit Butler <redline6561@gmail.com>"
|
||||||
:licence "LLGPL"
|
:licence "LLGPL"
|
||||||
:depends-on (:cl-markdown :docutils
|
:depends-on (:cl-markdown :docutils :closure-template :cl-fad)
|
||||||
:closure-template :cl-fad)
|
|
||||||
:components ((:module src
|
:components ((:module src
|
||||||
:components ((:file "packages")
|
:components ((:file "packages")
|
||||||
(:file "coleslaw"
|
(:file "coleslaw"
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
(in-package :coleslaw)
|
(in-package :coleslaw)
|
||||||
|
|
||||||
(defclass author ()
|
(defclass author ()
|
||||||
((name :initform nil
|
((name :initform nil :initarg :name
|
||||||
:accessor author-name)
|
:accessor author-name)
|
||||||
(url :initform nil
|
(url :initform nil :initarg :url
|
||||||
:accessor author-url)
|
:accessor author-url)
|
||||||
(ip :initform nil
|
(ip :initform nil :initarg :ip
|
||||||
:accessor author-ip)))
|
:accessor author-ip)))
|
||||||
|
|
||||||
(defclass comment ()
|
(defclass comment ()
|
||||||
((id :initform nil
|
((id :initform nil :initarg :id
|
||||||
:accessor comment-id)
|
:accessor comment-id)
|
||||||
(post :initform nil
|
(post :initform nil :initarg :post
|
||||||
:accessor comment-post)
|
:accessor comment-post)
|
||||||
(author :initform nil
|
(author :initform nil :initarg :author
|
||||||
:accessor comment-author)
|
:accessor comment-author)
|
||||||
(timestamp :initform nil
|
(timestamp :initform nil :initarg :timestamp
|
||||||
:accessor comment-timestamp)
|
:accessor comment-timestamp)
|
||||||
(content :initform nil
|
(content :initform nil :initarg :content
|
||||||
:accessor comment-content)
|
:accessor comment-content)
|
||||||
(parent :initform nil
|
(parent :initform nil :initarg :parent
|
||||||
:accessor comment-parent)))
|
:accessor comment-parent)))
|
||||||
|
|
||||||
(defgeneric make-comment (post author timestamp content
|
(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."))
|
(:documentation "Create a COMMENT with the given data."))
|
||||||
|
|
||||||
(defgeneric add-comment (comment post-id)
|
(defgeneric add-comment (comment post-id)
|
||||||
|
|
|
@ -22,6 +22,12 @@
|
||||||
#:find-by-date
|
#:find-by-date
|
||||||
#:find-by-range
|
#:find-by-range
|
||||||
|
|
||||||
|
#:post-id
|
||||||
|
#:post-title
|
||||||
|
#:post-tags
|
||||||
|
#:post-date
|
||||||
|
#:post-content
|
||||||
|
|
||||||
;; comments
|
;; comments
|
||||||
#:make-comment
|
#:make-comment
|
||||||
#:add-comment
|
#:add-comment
|
||||||
|
@ -29,6 +35,17 @@
|
||||||
#:render-comments
|
#:render-comments
|
||||||
#:find-comments
|
#:find-comments
|
||||||
|
|
||||||
|
#:author-name
|
||||||
|
#:author-url
|
||||||
|
#:author-ip
|
||||||
|
|
||||||
|
#:comment-id
|
||||||
|
#:comment-post
|
||||||
|
#:comment-author
|
||||||
|
#:comment-timestamp
|
||||||
|
#:comment-content
|
||||||
|
#:comment-parent
|
||||||
|
|
||||||
;; indices
|
;; indices
|
||||||
#:add-index
|
#:add-index
|
||||||
#:remove-index
|
#:remove-index
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
(in-package :coleslaw)
|
(in-package :coleslaw)
|
||||||
|
|
||||||
(defclass post ()
|
(defclass post ()
|
||||||
((id :initform nil
|
((id :initform nil :initarg :id
|
||||||
:accessor post-id)
|
:accessor post-id)
|
||||||
(title :initform nil
|
(title :initform nil :initarg :title
|
||||||
:accessor post-title)
|
:accessor post-title)
|
||||||
(tags :initform nil
|
(tags :initform nil :initarg :tags
|
||||||
:accessor post-tags)
|
:accessor post-tags)
|
||||||
(date :initform nil
|
(date :initform nil :initarg :date
|
||||||
:accessor post-date)
|
:accessor post-date)
|
||||||
(content :initform nil
|
(content :initform nil :initarg :content
|
||||||
:accessor post-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."))
|
(:documentation "Create a POST with the given data."))
|
||||||
|
|
||||||
(defgeneric add-post (post id)
|
(defgeneric add-post (post id)
|
||||||
|
|
29
themes/hyde/base.tmpl
Normal file
29
themes/hyde/base.tmpl
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{namespace coleslaw.theme.hyde}
|
||||||
|
|
||||||
|
{template base}
|
||||||
|
<!doctype html>{\n}
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{$title}</title>
|
||||||
|
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
|
||||||
|
<link href="http://fonts.googleapis.com/css?family=Vollkorn:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css" />
|
||||||
|
<link href= "{$siteroot}/css/style.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link rel="alternate" href="{$siteroot}/feed.atom" type="application/atom+xml" />
|
||||||
|
{if $headInject} {$headInject |noAutoescape} {/if}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="navigation">
|
||||||
|
{$navigation |noAutoescape}
|
||||||
|
{$title}
|
||||||
|
</div>
|
||||||
|
<div id="content">
|
||||||
|
{$content |noAutoescape}
|
||||||
|
</div>
|
||||||
|
{if $bodyInject} {$bodyInject |noAutoescape} {/if}
|
||||||
|
<div class="fineprint">
|
||||||
|
Unless otherwise credited all material {if $license} {$license} {else} © {/if} {$credits}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{/template}
|
31
themes/hyde/css/style.css
Normal file
31
themes/hyde/css/style.css
Normal file
|
@ -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) }
|
31
themes/hyde/index.tmpl
Normal file
31
themes/hyde/index.tmpl
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{namespace coleslaw.theme.hyde}
|
||||||
|
|
||||||
|
{template index}
|
||||||
|
{if $taglinks}
|
||||||
|
<div id="tagsoup">
|
||||||
|
<p>This blog covers: {$taglinks |noAutoescape}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{if $monthlinks}
|
||||||
|
<div id="monthsoup">
|
||||||
|
<p>View blogs from: {$monthlinks |noAutoescape}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<h1>{$title}</h1>
|
||||||
|
{foreach $post in $posts}
|
||||||
|
<div class="article-meta">
|
||||||
|
<a class="article-title" href="{$post.url}">{$post.title}</a>
|
||||||
|
<div class="date"> posted on {$post.date}</div>
|
||||||
|
<div class="article">{$post.contents |noAutoescape}</div>
|
||||||
|
{if $count}
|
||||||
|
<div class="comment-count">
|
||||||
|
<a href="{$post.url}">{$post.comments} comments</a>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/foreach}
|
||||||
|
<div id="relative-nav">
|
||||||
|
{if $prev} <a href="{$prev}">Previous</a> {/if}
|
||||||
|
{if $next} <a href="{$next}">Next</a> {/if}
|
||||||
|
</div>
|
||||||
|
{/template}
|
23
themes/hyde/post.tmpl
Normal file
23
themes/hyde/post.tmpl
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{namespace coleslaw.theme.hyde}
|
||||||
|
|
||||||
|
{template post}
|
||||||
|
<div class="article-meta">
|
||||||
|
<h1 class="title" {$title}>
|
||||||
|
<div class="tags"
|
||||||
|
Tagged as: {$tags}
|
||||||
|
</div>
|
||||||
|
<div class="date">
|
||||||
|
Written on {$date}
|
||||||
|
</div>
|
||||||
|
<div class="article-content">
|
||||||
|
{$content |noAutoescape}
|
||||||
|
</div>
|
||||||
|
<div class="relative-nav">
|
||||||
|
{if $prev} <a href="{$prev}">Previous</a> {/if}
|
||||||
|
{if $next} <a href="{$next}">Next</a> {/if}
|
||||||
|
</div>
|
||||||
|
{if $comments}
|
||||||
|
<div class="comments">{$comments |noAutoescape}</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/template}
|
Loading…
Add table
Reference in a new issue