disqus

inline javascript within handlebars template

落花浮王杯 提交于 2019-11-30 23:13:14
问题 Is there no way to have an inline script within a Handlebars template? <script type="text/x-handlebars"> I'm a row of type "foo" <script type="text/javascript">alert('hi');</script> </script> When the above template renders, the inline script is removed. What I am trying to do is include the disqus widget on a page. The widget is basically some markup + disqus script. The widget is to be included within a sub-view of my app. The subview is not visible by default but is displayed as per some

Disqus on an amp page inside an amp-iframe

别等时光非礼了梦想. 提交于 2019-11-30 15:29:47
I try to implement Disqus on an amp document. My idea is to use an amp-iframe which loads a small document which only contains Disqus. I used this amp frame <amp-iframe width="300" height="300" layout="responsive" sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-scripts" resizable frameborder="0" seamless src="/disquss/name-of-blog-post"> <div overflow tabindex=0 role=button aria-label="Read more">more!</div> </amp-iframe> However, chrome throws a content security policy violation: Refused to load the script ' https://a.disquscdn.com/next/embed/lounge.load

Showing Disqus comment count in a DIV or SPAN - not <a href>

北战南征 提交于 2019-11-30 04:59:54
We currently have our Disqus comment counts showing on each post on our homepage inside an <a href> tag, and we see this is updated by some javascript which detects whether #disqus_thread is present on the link. How do we show the comment count outside of an tag though? Is this possible? We're not interested in having a direct link to the comments, so we'd like to remove the link and just show the count alone. Update 11/3/2014: We now have a method for using comment counts on any element you want. The regular count.js script will now work if you: Use a disqus-comment-count class AND Use a data

我的网站搭建 (第21天) 评论功能设计

若如初见. 提交于 2019-11-29 21:50:22
一、前言 为什么一直拖着评论功能到现在才开始准备写,确实因为最近较忙,而且评论功能确实也不好写。之前,我上网查了很久,大概的方法总结起来有下面三个。 方法一:第三方社会化评论插件,如友言,多说,畅言,disqus。 方法二:Django评论库 方法三:自己写代码实现 先从第三方社会化评论插件开始,我没有做过多的涉及,而且插件众多,没有必要多花精力,使用专业的配置上就好,如果想使用评论插件,可以看这篇 https://www.cnblogs.com/KevinSong/p/4695899.html 。 至于Django的评论库,可以按照官方文档配置一番即可, https://django-contrib-comments.readthedocs.io/en/latest/ 。 下面开始说重点了,我采用的正好是第三种方法,这种逻辑性比较强,不过难度上确实不低。在这里必须要感谢杨仕航老师的精心讲解,教会了我使用子评论与父评论数据库自关联使用及Ajax加载评论。 二、建立评论模型 一个健全的评论模型,主要应该包括:评论内容、评论时间、评论人、评论对象,其中评论对象包括文章和评论,也就是说除了可以对文章进行评论,还可以对评论进行评论。涉及到对评论进行评论就要区分此时的评论是父评论还是它下面的子评论,这就是数据库自关联的使用。 我将评论模型建立如下,需要解释一下,root字段是某篇文章的源评论

Showing Disqus comment count in a DIV or SPAN - not <a href>

狂风中的少年 提交于 2019-11-29 02:46:01
问题 We currently have our Disqus comment counts showing on each post on our homepage inside an <a href> tag, and we see this is updated by some javascript which detects whether #disqus_thread is present on the link. How do we show the comment count outside of an tag though? Is this possible? We're not interested in having a direct link to the comments, so we'd like to remove the link and just show the count alone. 回答1: Update 11/3/2014: We now have a method for using comment counts on any element

号外号外!解决github+hexo+yilia评论插件的问题!!!

余生颓废 提交于 2019-11-28 18:35:24
本文转载于: 猿2048 网站 号外号外!解决github+hexo+yilia评论插件的问题!!! 先走一波效果图! 本人网站-- http://www.wenzheng.club/ ps:效果还是不错的,支持QQ微信登录,支持表情,甚至gif动图评论! 插件采用韩国服务器的来必力评论插件-- https://livere.com/ 电脑端效果如下 2018-02-0223:05:56 下面是手机端 相信看到这个帖子的同学,对于我这个话题肯定很感兴趣 Hexo博客的Yilia主题中评论系统只提供了畅言、网易云跟帖、多说和Disqus。 但是多说已经退出了江湖,网易云跟帖同样也不了了之,Disqus更不用说了,网址都进不去,岂不是更尴尬的存在? 但是Yilia的作者给我们留了开源的接口,支持我们添加其他的插件! 也有老哥创新性的加入了友言评论插件想试一试的同学可以看一下下面的链接!不过我没有成功,甚至在本地都没有成功,更不要说上传到Github了。 我参考了这篇帖子 http://blog.csdn.net/destinytaoer/article/details/78400021 好的开始咱们的表演! 一、注册账号,虽说livere是韩国的插件,但也支持qq邮箱登录注册,相当方便,网址-- https://livere.com/ 过程如下: 二、获取到了代码全部复制下来 三

Disqus comments fails to load on localhost?

情到浓时终转凉″ 提交于 2019-11-28 06:19:33
I would like to use the universal code and have ran into difficulties getting the most basic functionality done. I would like to create a shortname for test and one for my deployment , which I did from the Disqus admin panel. Here is the disqus code in my show action: # inside show.html.erb <%= render raw 'comments' %> # partial "comments" <div id="disqus_thread"></div> <script type="text/javascript"> var disqus_shortname = '<%= Post::DISQUS_SHORTNAME %>'; var disqus_identifier = '<%= @post.id %>'; var disqus_url = '<%= url_for([:blog, @topic, @post])%>'; (function() { var dsq = document

Several disqus-threads on one page

℡╲_俬逩灬. 提交于 2019-11-28 04:55:40
we have a website where we have list a lot of events, and would like to add discussions to each of the events. So we wanted to use disqus, and checked it out. Turns out they use global variables to configure the instance. like; var disqus_shortname = ''; var disqus_identifier = ''; var disqus_url = ''; This poses a problem for us, when we don't want to use the same identifier, but rather a unique one per disqus instance. tried putting each instantiation + configuration in iframes, but that really screwed up ie8. is there a better way of doing it? So, to sum it up; several instances of disqus

Disqus comments fails to load on localhost?

北战南征 提交于 2019-11-27 11:36:03
问题 I would like to use the universal code and have ran into difficulties getting the most basic functionality done. I would like to create a shortname for test and one for my deployment , which I did from the Disqus admin panel. Here is the disqus code in my show action: # inside show.html.erb <%= render raw 'comments' %> # partial "comments" <div id="disqus_thread"></div> <script type="text/javascript"> var disqus_shortname = '<%= Post::DISQUS_SHORTNAME %>'; var disqus_identifier = '<%= @post

Redirect all trailing slashes globally in express

谁说胖子不能爱 提交于 2019-11-27 03:50:22
I am using Node.js and Express and I have the following routing : app.get('/', function(req,res){ locals.date = new Date().toLocaleDateString(); res.render('home.ejs', locals); }); function lessonsRouter (req, res, next) { var lesson = req.params.lesson; res.render('lessons/' + lesson + '.ejs', locals_lessons); } app.get('/lessons/:lesson*', lessonsRouter); function viewsRouter (req, res, next) { var controllerName = req.params.controllerName; res.render(controllerName + '.ejs', locals_lessons); } app.get('/:controllerName', viewsRouter); I have a Disqus widget on my lessons pages and I have