Recently Written · git

coleslaw

Emacs mode for the "Coleslaw" site generator written in Common Lisp.

git clone https://github.com/equwal/coleslaw

Log | Files | Refs


docs/plugin-use.md (9791 bytes)

1 # General Use
2 
3 * To enable a plugin, add its name and settings to your
4   [.coleslawrc][config_file]. Plugin settings are described
5   below. Note that some plugins require additional setup.
6 
7 * Available plugins are listed below with usage descriptions and
8   config examples.
9 
10 ## Direct deployment via rsync
11 
12 **Description**: This directly sends the contents of the staging dir to the deployed directory.
13 The former default deployment method.
14 
15 **Example**: `(rsync "--exclude" ".git/" "--exclude" ".gitignore" "--copy-links")`
16 
17 ## Analytics via Google
18 
19 **Description**: Provides traffic analysis through
20   [Google Analytics](http://www.google.com/analytics/).
21 
22 **Example**: `(gtag :tracking-code "google-provided-unique-id")`
23 
24 **Note**: You can use `(analytics :tracking-code "google-provided-unique-id")` for the legacy integration with Google Analytics. 
25 
26 ## Analytics via Piwik
27 
28 **Description**: Provides traffic analysis through
29   [Piwik](https://www.piwik.org).
30 
31 **Example**: `(piwik :piwik-url "piwik.example.com" :piwik-site "example-site")`
32 
33 ## CL-WHO
34 
35 **Description**: Allows the user to write posts cl-who markup. Just create a
36 post with `format: cl-who` and the plugin will do the rest.
37 
38 **Example**: (cl-who)
39 
40 ## Comments via Disqus
41 
42 **Description**: Provides comment support through
43   [Disqus](http://www.disqus.com/).
44 
45 **Example**: `(disqus :shortname "disqus-provided-unique-id")`
46 
47 ## Comments via isso
48 
49 **Description**: Provides comment support through
50   [isso](https://posativ.org/isso/).
51 
52 **Example**: `(isso :isso-url "your-isso-url")`
53 
54 ## HTML5 Gifs via Gfycat
55 
56 **Description**: Provides support for embedding [gfycat](http://gfycat.com/) gifs.
57   Any content tagged 'gfycat' containing an IMG element of the form
58   `<img class="gfyitem" data-id="your-gfy-slug" />` will embed the
59   corresponding gfy.
60 
61 **Example**: `(gfycat)`
62 
63 ## Deploying / Hosting via Github Pages
64 
65 **Description**:
66 
67 Coleslaw deploys the blog to the specified branch of the given url.
68 * `url`     -- a string, git repository url that you already have a push access.
69 * `branch` -- a string, the branch to publish, either `"gh-pages"` or `"master"` can be used.
70 * `remote` -- a string, the remote name that we use in the deploy directory. defaulted to `"origin"`.
71 * `cname`  -- a string denoting the custom domain name, or `t`. If `cname` is `t`, the value is inferred
72   from the domain name specified in the `.coleslawrc`.
73   The value is written into `CNAME` file in the repository root.
74   For details, see [github-pages](http://pages.github.com/).
75 
76 **Example**:
77 
78 ``` lisp
79 (gh-pages :url "git@github.com:myaccount/myrepo.git"
80           :branch "gh-pages"
81           :remote "origin"
82           :cname t)
83 ```
84 
85 ## Incremental Builds
86 
87 **Description**: Primarily a performance enhancement. Caches the
88   content database between builds with
89   [cl-store][http://common-lisp.net/project/cl-store/] to avoid
90   parsing the whole git repo every time. May become default
91   functionality instead of a plugin at some point. Substantially
92   reduces runtime for medium to large sites.
93 
94 **Example**: `(incremental)`
95 
96 **Setup**: You must run the `examples/dump_db.sh` script to
97   generate a database dump for your site before enabling the
98   incremental plugin.
99 
100 ## LaTeX via Mathjax
101 
102 **Description**: Provides LaTeX support through
103   [Mathjax](http://www.mathjax.org/) for posts tagged with "math" and
104   indexes containing such posts. Any text enclosed in $$ will be
105   rendered, for example, ```$$ \lambda \scriptstyle{f}. (\lambda
106   x. (\scriptstyle{f} (x x)) \lambda x. (\scriptstyle{f} (x x)))
107   $$```.
108 
109 **Example**: ```(mathjax)```
110 
111 **Options**:
112 
113 - `:force`, when non-nil, will force the inclusion of MathJax on all
114   posts.  Default value is `nil`.
115 
116 - `:location` specifies the location of the `MathJax.js` file.  The
117   default value is `"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"`.
118   This is useful if you have a local copy of MathJax and want to use that
119   version.
120 
121 - `:preset` allows the specification of the config parameter of
122   `MathJax.js`.  The default value is `"TeX-AMS-MML_HTMLorMML"`.
123 
124 - `:config` is used as supplementary inline configuration to the
125   `MathJax.Hub.Config ({ ... });`. It is unused by default.
126 
127 ## Markless
128 
129 **Description**: [Markless](https://shirakumo.github.io/markless) is a
130   new document markup standard. To use it in your posts, create the
131   posts with `format: markless`. The output is generated using
132   [cl-markless-plump](https://shirakumo.github.io/cl-markless/cl-markless-plump/),
133   meaning any syntax extensions that work with it should also be
134   available in Coleslaw.
135 
136 **Example**: `(mess)`
137 
138 ## ReStructuredText
139 
140 **Description**: Some people really like
141   [ReStructuredText](http://docutils.sourceforge.net/rst.html). Who
142   knows why? But it only took one method to add, so yeah! Just create
143   a post with `format: rst` and the plugin will do the rest.
144 
145 **Example**: `(rst)`
146 
147 ## S3 Hosting
148 
149 **Description**: Allows hosting your blog entirely via
150   [Amazon S3](http://aws.amazon.com/s3/). It is suggested you closely
151   follow the relevant
152   [AWS guide](http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html)
153   to get the DNS setup correctly. Your `:auth-file` should match that
154   described in the
155   [ZS3 docs](http://www.xach.com/lisp/zs3/#file-credentials).
156 
157 **Example**: `(s3 :auth-file "/home/redline/.aws_creds" :bucket
158   "blog.redlinernotes.com")`
159 
160 ## Sitemap generator
161 
162 **Description**: This plugin generates a sitemap.xml under the page
163   root, which is useful if you want google to crawl your site.
164 
165 **Example**: `(sitemap)`
166 
167 ## Static Pages
168 
169 **Description**: This plugin allows you to add `.page` files to your
170   repo, that will be rendered to static pages at a designated URL.
171 
172 **Example**: `(static-pages)`
173 
174 ## Twitter
175 
176 **Description**: This plugin tweets every time a new post is added to
177   your repo. See Setup for an example of how to get your access token
178   & secret.
179 
180 **Example**: `(twitter :api-key "<api-key>"
181                        :api-secret "<api-secret>"
182                        :access-token "<access-token>"
183                        :access-secret "<access-secret>")`
184 
185 **Setup**:
186 - Create a new [twitter app](https://apps.twitter.com/). Take note of the api key & secret.
187 
188 - In the repl do the following:
189 ```lisp
190 ;; Load Chirp
191 (ql:quickload :chirp)
192 
193 ;; Use the api key & secret to get a URL where a pin code will be handled to you.
194 (chirp:initiate-authentication
195   :api-key "D1pMCK17gI10bQ6orBPS0w"
196   :api-secret "BfkvKNRRMoBPkEtDYAAOPW4s2G9U8Z7u3KAf0dBUA")
197 ;; => "https://api.twitter.com/oauth/authorize?oauth_token=cJIw9MJM5HEtQqZKahkj1cPn3m3kMb0BYEp6qhaRxfk"
198 
199 ;; Exchange the pin code for an access token and and access secret. Take note
200 ;; of them.
201 CL-USER> (chirp:complete-authentication "4173325")
202 ;; => "18403733-bXtuum6qbab1O23ltUcwIk2w9NS3RusUFiuum4D3w"
203 ;;    "zDFsFSaLerRz9PEXqhfB0h0FNfUIDgbEe59NIHpRWQbWk"
204 
205 ;; Finally verify the credentials
206 (chirp:account/verify-credentials)
207 #<CHIRP-OBJECTS:USER PuercoPop #18405433>
208 ```
209 
210 ## Twitter Summary Cards
211 
212 **Description**: Add Summary Card metadata to blog posts
213   to enhance twitter links to that content.
214 
215 **Example**: `(twitter-summary-card :twitter-handle "@redline6561")
216 
217 ## Versioning Deploys
218 
219 Either [automatic git interaction](#git-versioned) or [double
220 versioning](#double-versioning)
221 
222 ### Git Versioned
223 
224 **Description**: Automatically stages, commits, and/or pushes the server's
225 sources. Assumes that a git repository exists in the server's directory. Pushing
226 is optional.
227 
228 **Examples**: 
229 `(git-versioned "~/src/dir/" 'stage 'commit 'push)`
230 
231 
232 `(git-versioned "~/src/dir/" 'stage 'commit)`
233 
234 ### Double Versioning
235 
236 **Description**: Originally, this was Coleslaw's only deploy behavior.
237   Instead of deploying directly to `:deploy-dir`, creates `.curr` and
238   `.prev` symlinks in the *deploy-dir*, which point to timestamped
239   directories of the last two deploys of the site. Deploys prior to the
240   last two are automatically cleaned up.
241 
242 **Example**: `(versioned)`
243 
244 ## Wordpress Importer
245 
246 **NOTE**: This plugin really should be rewritten to act as a
247   standalone script. It is designed for one time use and using it
248   through a site config is pretty silly.
249 
250 **Description**: Import blog posts from Wordpress using their export
251   tool. Blog entries will be read from the XML and converted into
252   .post files. Afterwards the XML file will be deleted to prevent
253   reimporting. Optionally an `:output` argument may be supplied to the
254   plugin. If provided, it should be a directory in which to store the
255   .post files. Otherwise, the value of `:repo` in your .coleslawrc
256   will be used.
257 
258 **Example**: `(import :filepath "/home/redline/redlinernotes-export.timestamp.xml"
259                       :output "/home/redlinernotes/blog/")`
260 
261 [config_file]: http://github.com/redline6561/coleslaw/blob/master/examples/example.coleslawrc
262 
263 
264 ## Markdown Embeding youtube Youtube
265 
266 **Description**: Embed youtube videos in markdown using the shorthand syntax
267 `!yt[<video-id>(|options*)*]`.  Options can be *width*, *height* or any of the
268 [player parameters](https://developers.google.com/youtube/player_parameters).
269 
270 For example `!yt[oeul8fTG9dM|width=480,allowfullscreen]`.
271 
272 **Example**: `(3bmd-youtube)`
273 
274 ## Code Highlighting via Pygments
275 
276 **Description**: Provides code highlighting with [Pygments](http://pygments.org/)
277   instead of [colorize](http://www.cliki.net/colorize). Pygments supports over
278   300 languages and text formats. Look at
279   [3bmd](https://github.com/3b/3bmd/blob/master/README.md) for more info.
280 
281 **Example**: `(pygments)`
282 
283 **Setup**: Install `Pygments` and verify that the `pygmentize` command works (`pygmentize -V` should print the version number). You also need to verify that your theme includes an appropriate css file.