Bind content-text & add quotes to HTML attributes

This commit is contained in:
Javier Olaechea 2014-08-15 20:18:40 -05:00 committed by Brit Butler
parent 47a17508e8
commit a9d73e3b26

View file

@ -1,5 +1,5 @@
(defpackage :coleslaw-twitter-summary-card
(:use :cl)
(:use :cl :coleslaw)
(:export #:enable))
(in-package :coleslaw-twitter-summary-card)
@ -7,12 +7,15 @@
(defun summary-card (post twitter-handle)
"TODO: Figure if and how to include twitter:url meta property."
(format nil "<meta property=\"twitter:card\" content=\"summary\" />
~@[<meta property=\"twitter:author\" content=~A />~]
<meta property=\"twitter:title\" content=~A />
<meta property=\"twitter:description\" content=~A />"
~@[<meta property=\"twitter:author\" content=\"~A\" />~]
<meta property=\"twitter:title\" content=\"~A\" />
<meta property=\"twitter:description\" content=\"~A\" />"
twitter-handle
(title-of post)
(content-text post)))
(let ((text (content-text post)))
(if (< 200 (length text))
(subseq text 0 199)
text))))
(defun enable (&key twitter-handle)
(add-injection