Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Commit

Permalink
Add Disqus support (closes #5).
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
  • Loading branch information
Sébastien Gross authored and Sébastien Gross committed Mar 20, 2012
1 parent a8b73fb commit 9a10df2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
8 changes: 7 additions & 1 deletion example/sample.org
Expand Up @@ -8,7 +8,7 @@
#+URL: http://renard.github.com/o-blog

#+DEFAULT_CATEGORY: Tips

#+DISQUS: renard-o-blog

#+POST_BUILD_SHELL: cmd 1
#+POST_BUILD_SHELL: cmd 2
Expand Down Expand Up @@ -140,6 +140,9 @@ This is a sample blog to explain how [[https://github.com/renard/o-blog][o-blog]
:PAGE: changelog.html
:END:

- 2012-03-20
- Add [[http://disqus.com][Disqus]] support.

- 2012-03-06
- Add support for Font-Awesome

Expand Down Expand Up @@ -176,6 +179,7 @@ This is a sample blog to explain how [[https://github.com/renard/o-blog][o-blog]
- [[file:{lisp}(ob:path-to-root){/lisp}/tags/index.html][Tag cloud]]
- Multiple blogs
- [[file:{lisp}(ob:path-to-root){/lisp}/archives.html][Archives]]
- [[http://disqus.com][Disqus]] support.
- Publication
- Both synchrone and asynchrone publication
- Publish directly to the webserver (using tramp)
Expand Down Expand Up @@ -287,6 +291,8 @@ Structure used to define a blog:
directive.
- =default-category=: default category for posts defined by the
=#DEFAULT_CATEGORY:= header or =Blog=.
- =disqus=: [[http://docs.disqus.com/developers/universal/][disqus]] account (called a forum on [[http://disqus.com][Disqus]]) this system
belongs to. Defined by the \"#DISQUS\" header.

Example:

Expand Down
9 changes: 7 additions & 2 deletions o-blog.el
Expand Up @@ -5,7 +5,7 @@
;; Author: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
;; Keywords: emacs,
;; Created: 2012-01-04
;; Last changed: 2012-03-20 10:51:45
;; Last changed: 2012-03-20 11:18:53
;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/

;; This file is NOT part of GNU Emacs.
Expand Down Expand Up @@ -99,6 +99,9 @@ This is a good place for o-blog parser plugins."
- default-category: default category for posts defined by the
\"#DEFAULT_CATEGORY:\" header or \"Blog\".
- disqus: disqus account (called a forum on Disqus) this system
belongs to. Defined by the \"#DISQUS\" header.
"
(file nil :read-only)
(buffer nil :read-only)
Expand All @@ -111,7 +114,8 @@ This is a good place for o-blog parser plugins."
title
description
post-build-shell
default-category)
default-category
disqus)


(defstruct (ob:post :named)
Expand Down Expand Up @@ -316,6 +320,7 @@ defined, or interactivelly called with `prefix-arg'.
(setf (ob:blog-description blog) (or (ob:get-header "DESCRIPTION") "Description"))
(setf (ob:blog-post-build-shell blog) (ob:get-header "POST_BUILD_SHELL" t))
(setf (ob:blog-default-category blog) (or (ob:get-header "DEFAULT_CATEGORY") "Blog"))
(setf (ob:blog-disqus blog) (ob:get-header "DISQUS"))
blog))


Expand Down
1 change: 1 addition & 0 deletions templates/blog_post.html
Expand Up @@ -67,4 +67,5 @@ <h1><i class="icon-tags"></i> related tags</h1>
</ul>
</nav>
</footer>
<lisp>(ob:insert-template "plugin_disqus.html")</lisp>
<lisp>(ob:insert-template "page_footer.html")</lisp>
14 changes: 14 additions & 0 deletions templates/plugin_disqus.html
@@ -0,0 +1,14 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '<lisp>(ob:blog-disqus BLOG)</lisp>'; // required: replace example with your forum shortname

/* * * 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';
(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">blog comments powered by <span class="logo-disqus">Disqus</span></a>

0 comments on commit 9a10df2

Please sign in to comment.