|
@@ -0,0 +1,22 @@
|
|
1
|
+(defpackage :coleslaw-twitter-summary-card
|
|
2
|
+ (:use :cl)
|
|
3
|
+ (:export #:enable))
|
|
4
|
+
|
|
5
|
+(in-package :coleslaw-twitter-summary-card)
|
|
6
|
+
|
|
7
|
+(defun summary-card (post twitter-handle)
|
|
8
|
+ "TODO: Figure if and how to include twitter:url meta property."
|
|
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 />"
|
|
13
|
+ twitter-handle
|
|
14
|
+ (title-of post)
|
|
15
|
+ (content-text post)))
|
|
16
|
+
|
|
17
|
+(defun enable (&key twitter-handle)
|
|
18
|
+ (add-injection
|
|
19
|
+ (lambda (x)
|
|
20
|
+ (when (typep x 'post)
|
|
21
|
+ (summary-card x twitter-handle)))
|
|
22
|
+ :head))
|