-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e5f082
commit 0ea40a4
Showing
5 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;;;; | ||
title: Math Example | ||
tags: plugin,math | ||
tags: plugin, math | ||
created-at: 2024-05-09 10:00 | ||
format: md | ||
;;;;; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
(uiop:define-package #:staticl/plugins/disqus | ||
(:use #:cl) | ||
(:import-from #:staticl/plugin | ||
#:plugin) | ||
(:import-from #:staticl/site | ||
#:site) | ||
(:import-from #:staticl/injections | ||
#:add-injection | ||
#:content-with-injections-mixin) | ||
(:import-from #:staticl/content | ||
#:has-tag-p) | ||
(:import-from #:serapeum | ||
#:fmt | ||
#:->)) | ||
(in-package #:staticl/plugins/disqus) | ||
|
||
|
||
(defparameter *code-to-inject* " | ||
<div id=\"disqus_thread\"></div> | ||
<script type=\"text/javascript\"> | ||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | ||
var disqus_shortname = '~A'; | ||
/* * * DON'T EDIT BELOW THIS LINE * * */ | ||
(function() { | ||
var dsq = document.createElement('script'); | ||
dsq.type = 'text/javascript'; | ||
dsq.async = true; | ||
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | ||
dsq.setAttribute('data-timestamp', +new Date()); | ||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | ||
})(); | ||
</script> | ||
<noscript>Please enable JavaScript to view the <a href=\"http://disqus.com/?ref_noscript\">comments powered by Disqus.</a></noscript> | ||
<a href=\"http://disqus.com\" class=\"dsq-brlink\">comments powered by <span class=\"logo-disqus\">Disqus</span></a> | ||
") | ||
|
||
|
||
(defclass disqus (plugin) | ||
((shortname :initarg :shortname | ||
:initform (error "Shortname should be given.") | ||
:type string | ||
:reader disqus-shortname))) | ||
|
||
|
||
(-> disqus (string) | ||
(values disqus &optional)) | ||
|
||
(defun disqus (shortname) | ||
"Enables Disqus on the page if it's content has tag equal to the TAG-NAME or if FORCE argument was given." | ||
(make-instance 'disqus | ||
:shortname shortname)) | ||
|
||
|
||
(defmethod staticl/pipeline:process-items ((site site) (node disqus) content-items) | ||
(loop for item in content-items | ||
when (typep item 'staticl/content/post:post) | ||
do (add-injection item "after_content" | ||
(fmt *code-to-inject* | ||
(disqus-shortname node))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,6 @@ MathJax = { | |
") | ||
|
||
" | ||
" | ||
|
||
|
||
(defclass mathjax (plugin) | ||
((force :initarg :force | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters