|
|
|
|
1
|
(defpackage :coleslaw-twitter-summary-card
|
1
|
(defpackage :coleslaw-twitter-summary-card
|
2
|
- (:use :cl)
|
|
|
|
|
2
|
+ (:use :cl :coleslaw)
|
3
|
(:export #:enable))
|
3
|
(:export #:enable))
|
4
|
|
4
|
|
5
|
(in-package :coleslaw-twitter-summary-card)
|
5
|
(in-package :coleslaw-twitter-summary-card)
|
|
|
|
|
7
|
(defun summary-card (post twitter-handle)
|
7
|
(defun summary-card (post twitter-handle)
|
8
|
"TODO: Figure if and how to include twitter:url meta property."
|
8
|
"TODO: Figure if and how to include twitter:url meta property."
|
9
|
(format nil "<meta property=\"twitter:card\" content=\"summary\" />
|
9
|
(format nil "<meta property=\"twitter:card\" content=\"summary\" />
|
10
|
-~@[<meta property=\"twitter:author\" content=~A />~]
|
|
|
11
|
-<meta property=\"twitter:title\" content=~A />
|
|
|
12
|
-<meta property=\"twitter:description\" content=~A />"
|
|
|
|
|
10
|
+~@[<meta property=\"twitter:author\" content=\"~A\" />~]
|
|
|
11
|
+<meta property=\"twitter:title\" content=\"~A\" />
|
|
|
12
|
+<meta property=\"twitter:description\" content=\"~A\" />"
|
13
|
twitter-handle
|
13
|
twitter-handle
|
14
|
(title-of post)
|
14
|
(title-of post)
|
15
|
- (content-text post)))
|
|
|
|
|
15
|
+ (let ((text (content-text post)))
|
|
|
16
|
+ (if (< 200 (length text))
|
|
|
17
|
+ (subseq text 0 199)
|
|
|
18
|
+ text))))
|
16
|
|
19
|
|
17
|
(defun enable (&key twitter-handle)
|
20
|
(defun enable (&key twitter-handle)
|
18
|
(add-injection
|
21
|
(add-injection
|