Skip to content

Instantly share code, notes, and snippets.

@henriqueutsch
Created August 9, 2018 20:51
Show Gist options
  • Save henriqueutsch/99f437839ad32964ff1edb7aae682980 to your computer and use it in GitHub Desktop.
Save henriqueutsch/99f437839ad32964ff1edb7aae682980 to your computer and use it in GitHub Desktop.
div#disqus_thread
javascript:
var disqus_config = function () {
this.page.url = "https://www.fulllifeacademy.com.br#{current_page.url}";
this.page.title = "#{current_article.data.title}"
this.page.identifier = "#{idpost(current_article.data.title)}";
this.page.category_id = "#{idcategory(current_article.data.category)}";
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://full-life-academy.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
Helper
def idpost(posttitle)
page_articles.each_with_index do |article, i|
return i if article.title == posttitle
end
end
def idcategory(postcategory)
all_categories.each_with_index do |category, i|
return i if category == postcategory
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment