Bind content-text & add quotes to HTML attributes
This commit is contained in:
parent
47a17508e8
commit
a9d73e3b26
1 changed files with 8 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
(defpackage :coleslaw-twitter-summary-card
|
(defpackage :coleslaw-twitter-summary-card
|
||||||
(:use :cl)
|
(:use :cl :coleslaw)
|
||||||
(:export #:enable))
|
(:export #:enable))
|
||||||
|
|
||||||
(in-package :coleslaw-twitter-summary-card)
|
(in-package :coleslaw-twitter-summary-card)
|
||||||
|
@ -7,12 +7,15 @@
|
||||||
(defun summary-card (post twitter-handle)
|
(defun summary-card (post twitter-handle)
|
||||||
"TODO: Figure if and how to include twitter:url meta property."
|
"TODO: Figure if and how to include twitter:url meta property."
|
||||||
(format nil "<meta property=\"twitter:card\" content=\"summary\" />
|
(format nil "<meta property=\"twitter:card\" content=\"summary\" />
|
||||||
~@[<meta property=\"twitter:author\" content=~A />~]
|
~@[<meta property=\"twitter:author\" content=\"~A\" />~]
|
||||||
<meta property=\"twitter:title\" content=~A />
|
<meta property=\"twitter:title\" content=\"~A\" />
|
||||||
<meta property=\"twitter:description\" content=~A />"
|
<meta property=\"twitter:description\" content=\"~A\" />"
|
||||||
twitter-handle
|
twitter-handle
|
||||||
(title-of post)
|
(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)
|
(defun enable (&key twitter-handle)
|
||||||
(add-injection
|
(add-injection
|
||||||
|
|
Loading…
Add table
Reference in a new issue