From 9a10df27767f4b11f79c57f3437a34adb81fd5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gross?= Date: Tue, 20 Mar 2012 12:07:15 +0100 Subject: [PATCH] Add Disqus support (closes #5). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Gross --- example/sample.org | 8 +++++++- o-blog.el | 9 +++++++-- templates/blog_post.html | 1 + templates/plugin_disqus.html | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 templates/plugin_disqus.html diff --git a/example/sample.org b/example/sample.org index b63e4f6..48e9a55 100644 --- a/example/sample.org +++ b/example/sample.org @@ -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 @@ -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 @@ -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) @@ -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: diff --git a/o-blog.el b/o-blog.el index 4921c3b..a687402 100644 --- a/o-blog.el +++ b/o-blog.el @@ -5,7 +5,7 @@ ;; Author: Sébastien Gross ;; 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. @@ -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) @@ -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) @@ -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)) diff --git a/templates/blog_post.html b/templates/blog_post.html index b5cadd3..85a8194 100644 --- a/templates/blog_post.html +++ b/templates/blog_post.html @@ -67,4 +67,5 @@

related tags

+ (ob:insert-template "plugin_disqus.html") (ob:insert-template "page_footer.html") diff --git a/templates/plugin_disqus.html b/templates/plugin_disqus.html new file mode 100644 index 0000000..319d984 --- /dev/null +++ b/templates/plugin_disqus.html @@ -0,0 +1,14 @@ +
+ + +blog comments powered by Disqus