mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-08-13 15:53:46 -04:00
added disqus comment support
This commit is contained in:
parent
6c9f1567ce
commit
416667ccaa
2
Rakefile
2
Rakefile
@ -47,7 +47,7 @@ task :generate_style do
|
|||||||
end
|
end
|
||||||
|
|
||||||
desc "Generate site files only"
|
desc "Generate site files only"
|
||||||
task :generate_site => :clean do
|
task :generate_site => [:clean, :generate_style] do
|
||||||
puts ">>> Generating site files <<<"
|
puts ">>> Generating site files <<<"
|
||||||
system "jekyll"
|
system "jekyll"
|
||||||
system "mv #{site}/atom.html #{site}/atom.xml"
|
system "mv #{site}/atom.html #{site}/atom.xml"
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
blog_title: My Octopress Blog
|
blog_title: My Octopress Blog
|
||||||
|
full_url:
|
||||||
google_site_search_id:
|
google_site_search_id:
|
||||||
|
disqus_site: designenthusiast
|
||||||
---
|
---
|
||||||
|
|
||||||
!!! 1.1 Transitional
|
!!! 1.1 Transitional
|
||||||
@ -45,6 +47,13 @@ google_site_search_id:
|
|||||||
%p.pubdate
|
%p.pubdate
|
||||||
Published:
|
Published:
|
||||||
=page.date.strftime("%d %b, %Y")
|
=page.date.strftime("%d %b, %Y")
|
||||||
|
#disqus_thread
|
||||||
|
:javascript
|
||||||
|
var disqus_developer = true;
|
||||||
|
var disqus_url = "#{page.full_url}/#{page.url}";
|
||||||
|
%noscript
|
||||||
|
%a(href="http://designenthusiast.disqus.com/?url=ref") View the discussion thread
|
||||||
|
%script(type="text/javascript" src="http://disqus.com/forums/#{page.disqus_site}/embed.js")
|
||||||
- else
|
- else
|
||||||
= content
|
= content
|
||||||
#sidebar
|
#sidebar
|
||||||
@ -55,7 +64,18 @@ google_site_search_id:
|
|||||||
.page_width
|
.page_width
|
||||||
= "Copyright © #{Time.now.strftime('%Y')} - #{page.blog_title} | "
|
= "Copyright © #{Time.now.strftime('%Y')} - #{page.blog_title} | "
|
||||||
%span.credit Powered by <a href="http://github.com/imathis/octopress/">Octopress</a>
|
%span.credit Powered by <a href="http://github.com/imathis/octopress/">Octopress</a>
|
||||||
|
//Disqus Commens code
|
||||||
|
:javascript
|
||||||
|
(function() {
|
||||||
|
var links = document.getElementsByTagName('a');
|
||||||
|
var query = '?';
|
||||||
|
for(var i = 0; i < links.length; i++) {
|
||||||
|
if(links[i].href.indexOf('#disqus_thread') >= 0) {
|
||||||
|
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/#{page.disqus_site}/get_num_replies.js' + query + '"></' + 'script>');
|
||||||
|
})();
|
||||||
//Google Analytics code
|
//Google Analytics code
|
||||||
:javascript
|
:javascript
|
||||||
try {
|
try {
|
||||||
|
@ -7,5 +7,10 @@ title: Blog
|
|||||||
.article
|
.article
|
||||||
%h2= link_to(post.title, post.url, {:class=>"title"})
|
%h2= link_to(post.title, post.url, {:class=>"title"})
|
||||||
= post.content
|
= post.content
|
||||||
|
.footer
|
||||||
|
- if post.data["comments_off"]
|
||||||
|
%em.comments_off Comments disabled
|
||||||
|
- else
|
||||||
|
%a(href="#{post.url}/#disqus_thread")Comments
|
||||||
.footer
|
.footer
|
||||||
%a(href="/archives.html" title="archives") « Blog Archives
|
%a(href="/archives.html" title="archives") « Blog Archives
|
Loading…
Reference in New Issue
Block a user