Bläddra i källkod

Merge branch 'pr/89'

Brit Butler 9 år sedan
förälder
incheckning
96512011a0
8 ändrade filer med 121 tillägg och 20 borttagningar
  1. 1 0
      .gitignore
  2. 22 0
      .travis.yml
  3. 4 1
      README.md
  4. 9 13
      coleslaw.asd
  5. 51 0
      docs/hacking.md
  6. 20 0
      plugins/isso.lisp
  7. 3 6
      plugins/s3.lisp
  8. 11 0
      tests/tests.lisp

+ 1 - 0
.gitignore

5
 generated/
5
 generated/
6
 .curr
6
 .curr
7
 .prev
7
 .prev
8
+build/

+ 22 - 0
.travis.yml

1
+language: common-lisp
2
+sudo: false
3
+
4
+env:
5
+  global:
6
+    - PATH=~/.roswell/bin:$PATH
7
+    - ROSWELL_INSTALL_DIR=$HOME/.roswell
8
+  matrix:
9
+    - LISP=sbcl-bin
10
+    - LISP=ccl-bin
11
+
12
+install:
13
+  - curl -L https://raw.githubusercontent.com/snmsts/roswell/release/scripts/install-for-ci.sh | sh
14
+
15
+cache:
16
+  directories:
17
+    - $HOME/.roswell
18
+    - $HOME/.config/common-lisp
19
+
20
+script:
21
+  - ros -s prove -e "(ql:quickload '(coleslaw coleslaw-test))"
22
+                 -e '(or (prove:run :coleslaw-test) (uiop:quit -1))'

+ 4 - 1
README.md

1
 # coleslaw
1
 # coleslaw
2
 
2
 
3
+[![Build Status](https://travis-ci.org/kingcons/coleslaw.svg?branch=master)](https://travis-ci.org/kingcons/coleslaw)
4
+[![Quicklisp](http://quickdocs.org/badge/coleslaw.svg)](http://quickdocs.org/coleslaw/)
5
+
3
 <img src="https://raw.github.com/redline6561/coleslaw/master/themes/hyde/css/logo_medium.jpg" alt="coleslaw logo" align="right"/>
6
 <img src="https://raw.github.com/redline6561/coleslaw/master/themes/hyde/css/logo_medium.jpg" alt="coleslaw logo" align="right"/>
4
 
7
 
5
 > [Czeslaw Milosz](http://blog.redlinernotes.com/tag/milosz.html) was the writer-in-residence at UNC c. 1992.
8
 > [Czeslaw Milosz](http://blog.redlinernotes.com/tag/milosz.html) was the writer-in-residence at UNC c. 1992.
23
   * Sitemap generation
26
   * Sitemap generation
24
   * Incremental builds
27
   * Incremental builds
25
   * Analytics via Google
28
   * Analytics via Google
26
-  * Comments via [Disqus](http://disqus.com/)
29
+  * Comments via [Disqus](http://disqus.com/) or [isso](http://posativ.org/isso)
27
   * Hosting via [Github Pages](https://pages.github.com/) or [Amazon S3](http://aws.amazon.com/s3/)
30
   * Hosting via [Github Pages](https://pages.github.com/) or [Amazon S3](http://aws.amazon.com/s3/)
28
   * Embedding [gfycats](http://gfycat.com/)
31
   * Embedding [gfycats](http://gfycat.com/)
29
   * [Tweeting](http://twitter.com/) about new posts
32
   * [Tweeting](http://twitter.com/) about new posts

+ 9 - 13
coleslaw.asd

26
                (:file "indexes")
26
                (:file "indexes")
27
                (:file "feeds")
27
                (:file "feeds")
28
                (:file "coleslaw"))
28
                (:file "coleslaw"))
29
-  :in-order-to ((test-op (load-op coleslaw-tests)))
30
-  :perform (test-op :after (op c)
31
-                    (funcall (intern "RUN!" :coleslaw-tests)
32
-                             (intern "COLESLAW-TESTS" :coleslaw-tests))))
29
+  :in-order-to ((test-op (test-op coleslaw-test))))
33
 
30
 
34
-(defsystem #:coleslaw-tests
31
+(defsystem #:coleslaw-test
35
   :description "A test suite for coleslaw."
32
   :description "A test suite for coleslaw."
36
   :license "BSD"
33
   :license "BSD"
37
   :author "Brit Butler <redline6561@gmail.com>"
34
   :author "Brit Butler <redline6561@gmail.com>"
38
-  :depends-on (coleslaw stefil)
39
-  :pathname "tests/"
40
-  :serial t
41
-  :components ())
42
-
43
-(defmethod operation-done-p ((op test-op)
44
-                             (c (eql (find-system :coleslaw))))
45
-  (values nil))
35
+  :depends-on (:coleslaw :prove)
36
+  :defsystem-depends-on (:prove-asdf)
37
+  :components ((:module "tests"
38
+                :components
39
+                        ((:test-file "tests"))))
40
+  :perform (test-op :after (op c)
41
+                    (uiop:symbol-call :prove 'run c)))
46
 
42
 
47
 (defpackage #:coleslaw-conf (:export #:*basedir*))
43
 (defpackage #:coleslaw-conf (:export #:*basedir*))
48
 (defparameter coleslaw-conf:*basedir*
44
 (defparameter coleslaw-conf:*basedir*

+ 51 - 0
docs/hacking.md

341
    Content Types it includes or the CONTENT which indexes it appears
341
    Content Types it includes or the CONTENT which indexes it appears
342
    on is not yet clear.
342
    on is not yet clear.
343
 
343
 
344
+### Contributing
345
+
346
+The preferred workflow is more or less:
347
+
348
+    - fork and clone
349
+    - make a branch
350
+    - commit your changes
351
+    - push your branch to your github fork
352
+    - open a Pull Request
353
+
354
+#### Fork and clone
355
+
356
+You may clone the main github repository or your fork, whichever you cloned
357
+will be known as origin in your git repository. You have to add the other git
358
+repository to your remotes, so if you cloned from your fork execute:
359
+
360
+
361
+```bash
362
+git remote add upstream git@github.com:redline6561/coleslaw.git
363
+```
364
+
365
+If you cloned from the main github repository execute:
366
+
367
+```bash
368
+git remote add fork git@github.com:<YourUsername>/coleslaw.git
369
+```
370
+
371
+For the rest of the steps we will assume you cloned from your fork and that the main github repository has the remote name of upstream.
372
+
373
+#### Make a branch
374
+
375
+```bash
376
+git checkout -b <branch_name>
377
+```
378
+
379
+It is important to work always on branch so one can track changes in upstream by simply executing ```git pull upstream master:master``` from the master branch. If one can't come up with a suitable branch name just name it patch-n.
380
+2
381
+#### Commit your changes
382
+
383
+Make the changes you want to coleslaw, add the files with that changes (```git add <path/to/file>```) and commit them (```git commit```). Your commit message should strive to sum up what has changes and why.
384
+
385
+#### Push your branch to your github fork
386
+
387
+```bash
388
+git push origin branch
389
+```
390
+
391
+#### Open a Pull Request
392
+
393
+After pushing the branch to your fork, on github you should see a button to open a pull request. In the PR message give the rationale for your changes.
394
+
344
 [closure_template]: https://github.com/archimag/cl-closure-template
395
 [closure_template]: https://github.com/archimag/cl-closure-template
345
 [api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
396
 [api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
346
 [clmd]: https://github.com/gwkkwg/cl-markdown
397
 [clmd]: https://github.com/gwkkwg/cl-markdown

+ 20 - 0
plugins/isso.lisp

1
+(defpackage :coleslaw-isso
2
+  (:use :cl)
3
+  (:export #:enable)
4
+  (:import-from :coleslaw #:add-injection
5
+                          #:post))
6
+
7
+(in-package :coleslaw-isso)
8
+
9
+(defvar *isso-header*
10
+  "<div class=\"comments\">
11
+      <section id=\"isso-thread\"></section>
12
+      <script data-isso=\"~a/\"
13
+              src=\"~a/js/embed.min.js\"></script>
14
+    </div>")
15
+
16
+(defun enable (&key isso-url)
17
+  (flet ((inject-p (x)
18
+           (when (typep x 'post)
19
+             (format nil *isso-header* isso-url))))
20
+    (add-injection #'inject-p :body)))

+ 3 - 6
plugins/s3.lisp

10
 
10
 
11
 (in-package :coleslaw-s3)
11
 (in-package :coleslaw-s3)
12
 
12
 
13
-(defparameter *credentials* nil
14
-  "The credentials to authenticate with Amazon Web Services.
15
-Stored in a file with the access key on the first line
16
-and the secret key on the second.")
17
-
18
 (defparameter *content-type-map* '(("html" . "text/html")
13
 (defparameter *content-type-map* '(("html" . "text/html")
19
                                    ("css" . "text/css")
14
                                    ("css" . "text/css")
20
                                    ("png" . "image/png")
15
                                    ("png" . "image/png")
53
     (zs3:delete-objects (stale-keys) *bucket*)))
48
     (zs3:delete-objects (stale-keys) *bucket*)))
54
 
49
 
55
 (defun enable (&key auth-file bucket)
50
 (defun enable (&key auth-file bucket)
56
-  (setf *credentials* (zs3:file-credentials auth-file)
51
+  "AUTH-FILE: Path to file with the access key on the first line and the secret 
52
+   key on the second."
53
+  (setf zs3:*credentials* (zs3:file-credentials auth-file)
57
         *bucket* bucket))
54
         *bucket* bucket))

+ 11 - 0
tests/tests.lisp

1
+(defpackage :coleslaw-tests
2
+  (:use :cl :prove))
3
+
4
+(in-package :coleslaw-tests)
5
+
6
+(plan nil)
7
+
8
+(deftest 1-is-a-number
9
+  (is-type 1 'fixnum))
10
+
11
+(finalize)