Compare commits

..

No commits in common. "master" and "fix-extensionless-routing" have entirely different histories.

7 changed files with 23 additions and 31 deletions

View file

@ -28,13 +28,13 @@ testing is primarily done on [SBCL](http://www.sbcl.org/) and [CCL](http://ccl.c
* Themes
* A [Plugin API](docs/plugin-api.md) and [**plugins**](docs/plugin-use.md) for...
| plugins | plugins | plugins |
|--------------------------------------------------------|----------------------------------------------|----------------------------------------------------------|
| Sitemap generation | Incremental builds | Analytics via Google or [Matomo](https://www.matomo.org) |
| Comments via [Disqus](http://disqus.com/) | Comments via [isso](http://posativ.org/isso) | Hosting via [Amazon S3](http://aws.amazon.com/s3/) |
| Hosting via [Github Pages](https://pages.github.com/) | Embedding [gfycats](http://gfycat.com/) | [Tweeting](http://twitter.com/) about new posts |
| [Mathjax](http://mathjax.org/) | Posts in ReStructured Text | [Wordpress](http://wordpress.org/) import |
| [Pygments](http://pygments.org/) | [colorize](http://www.cliki.net/colorize) | |
| plugins | plugins | plugins |
|--------------------------------------------------------|----------------------------------------------|-------------------------------------------------------|
| Sitemap generation | Incremental builds | Analytics via Google or [Piwik](http://www.piwik.org) |
| Comments via [Disqus](http://disqus.com/) | Comments via [isso](http://posativ.org/isso) | Hosting via [Amazon S3](http://aws.amazon.com/s3/) |
| Hosting via [Github Pages](https://pages.github.com/) | Embedding [gfycats](http://gfycat.com/) | [Tweeting](http://twitter.com/) about new posts |
| [Mathjax](http://mathjax.org/) | Posts in ReStructured Text | [Wordpress](http://wordpress.org/) import |
| [Pygments](http://pygments.org/) | [colorize](http://www.cliki.net/colorize) | |
## Installation/Tutorial

View file

@ -26,9 +26,9 @@ The former default deployment method.
## Analytics via Piwik
**Description**: Provides traffic analysis through
[Matomo](https://www.matomo.org).
[Piwik](https://www.piwik.org).
**Example**: `(matomo :matomo-url "matomo.example.com" :matomo-site "example-site")`
**Example**: `(piwik :piwik-url "piwik.example.com" :piwik-site "example-site")`
## CL-WHO

View file

@ -24,11 +24,11 @@ while read oldrev newrev refname; do
echo -e "\n Master updated. Running coleslaw...\n"
if [ $LISP = sbcl ]; then
sbcl --eval "(ql:quickload 'coleslaw)" \
--eval "(coleslaw:main \"$TMP_GIT_CLONE\" :oldrev \"$oldrev\")" \
--eval "(coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\")" \
--eval "(uiop:quit)"
elif [ $LISP = ccl ]; then
ccl -e "(ql:quickload 'coleslaw)" \
-e "(coleslaw:main \"$TMP_GIT_CLONE\" :oldrev \"$oldrev\")" \
-e "(coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\")" \
-e "(uiop:quit)"
else
echo -e "$LISP is not a supported lisp dialect at this time. Exiting.\n"

View file

@ -7,9 +7,7 @@
(:import-from :coleslaw #:slugify
#:load-config
#:*config*
#:repo
#:repo-dir
#:separator)
#:repo)
(:import-from :local-time #:+short-month-names+)
(:import-from :cl-ppcre #:regex-replace-all))

View file

@ -1,11 +1,11 @@
(defpackage :coleslaw-matomo
(defpackage :coleslaw-piwik
(:use :cl)
(:export #:enable)
(:import-from :coleslaw #:add-injection))
(in-package :coleslaw-matomo)
(in-package :coleslaw-piwik)
(defvar *matomo-js*
(defvar *piwik-js*
"<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
@ -13,13 +13,13 @@
(function() {
var u='//~a/';
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '~a']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>")
(defun enable (&key matomo-url matomo-site)
(let ((snippet (format nil *matomo-js* matomo-url matomo-site)))
(defun enable (&key piwik-url piwik-site)
(let ((snippet (format nil *piwik-js* piwik-url piwik-site)))
(add-injection (constantly snippet) :head)))

View file

@ -42,10 +42,7 @@
(publish ctype))
(do-subclasses (itype index)
(publish itype))
(let ((recent-posts (reduce #'(lambda (a b)
(if (< (index-name a) (index-name b))
a b))
(find-all 'numeric-index))))
(let ((recent-posts (first (find-all 'numeric-index))))
(update-symlink "index.html" (page-url recent-posts)))))
(defgeneric deploy (staging)

View file

@ -5,9 +5,6 @@
(defvar *all-tags* nil
"The list of tags which content has been tagged with.")
(defvar *pages-listings-on-index* 10
"Page listings in the index per page.")
(defclass index ()
((url :initarg :url :reader page-url)
(name :initarg :name :reader index-name)
@ -70,14 +67,14 @@
(defmethod discover ((doc-type (eql (find-class 'numeric-index))))
(let ((content (by-date (find-all 'post))))
(dotimes (i (ceiling (length content) *pages-listings-on-index*))
(dotimes (i (ceiling (length content) 10))
(add-document (index-by-n i content)))))
(defun index-by-n (i content)
"Return the index for the Ith page of CONTENT in reverse chronological order."
(let ((content (subseq content (* *pages-listings-on-index* i))))
(let ((content (subseq content (* 10 i))))
(make-instance 'numeric-index :slug (1+ i) :name (1+ i)
:content (take-up-to *pages-listings-on-index* content)
:content (take-up-to 10 content)
:title "Recent Content")))
(defmethod publish ((doc-type (eql (find-class 'numeric-index))))