Add gfycat plugin.
This commit is contained in:
parent
4fd195db19
commit
3490af0287
3 changed files with 33 additions and 0 deletions
2
NEWS.md
2
NEWS.md
|
@ -12,6 +12,8 @@ Legend:
|
||||||
* Coleslaw now handles **deploy-dir**, **repo**, and **staging-dir**
|
* Coleslaw now handles **deploy-dir**, **repo**, and **staging-dir**
|
||||||
config options more gracefully. Previously, various errors could be
|
config options more gracefully. Previously, various errors could be
|
||||||
encountered if directory options lacked a trailing slash.
|
encountered if directory options lacked a trailing slash.
|
||||||
|
* **New Plugin**: Support for [embedded gfycats][http://gfycat.com/] has been added.
|
||||||
|
|
||||||
|
|
||||||
## Changes for 0.9.6 (2014-09-27):
|
## Changes for 0.9.6 (2014-09-27):
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,12 @@
|
||||||
|
|
||||||
**Example**: `(disqus :shortname "disqus-provided-unique-id")`
|
**Example**: `(disqus :shortname "disqus-provided-unique-id")`
|
||||||
|
|
||||||
|
## HTML5 Gifs via Gfycat
|
||||||
|
|
||||||
|
**Description**: Provides support for embedding [gfycat](http://gfycat.com/) gifs.
|
||||||
|
|
||||||
|
**Example**: `(gfycat)`
|
||||||
|
|
||||||
## Hosting via Github Pages
|
## Hosting via Github Pages
|
||||||
|
|
||||||
**Description**: Allows hosting with CNAMEs via
|
**Description**: Allows hosting with CNAMEs via
|
||||||
|
|
25
plugins/gfycat.lisp
Normal file
25
plugins/gfycat.lisp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
(defpackage :coleslaw-gfycat
|
||||||
|
(:use :cl)
|
||||||
|
(:export #:enable)
|
||||||
|
(:import-from :coleslaw #:add-injection
|
||||||
|
#:content
|
||||||
|
#:tag-p))
|
||||||
|
|
||||||
|
(in-package :coleslaw-gfycat)
|
||||||
|
|
||||||
|
(defvar *gfycat-header*
|
||||||
|
"<script>
|
||||||
|
(function(d, t) {
|
||||||
|
var g = d.createElement(t),
|
||||||
|
s = d.getElementsByTagName(t)[0];
|
||||||
|
g.src = 'http://assets.gfycat.com/js/gfyajax-0.517d.js';
|
||||||
|
s.parentNode.insertBefore(g, s);
|
||||||
|
}(document, 'script'));
|
||||||
|
</script>")
|
||||||
|
|
||||||
|
(defun enable ()
|
||||||
|
(flet ((inject-p (x)
|
||||||
|
(when (and (typep x 'content)
|
||||||
|
(tag-p "gfycat" x))
|
||||||
|
*gfycat-header*)))
|
||||||
|
(add-injection #'inject-p :head)))
|
Loading…
Add table
Reference in a new issue