blogit icon indicating copy to clipboard operation
blogit copied to clipboard

Disqus shortname is not being put into the page

Open jasonbuehler opened this issue 9 years ago • 1 comments

I am trying to use disqus comments, somehow the disqus shortname is not being accessed correctly to define the javascript comment object.

If I output the Blogit.configuration I get this:

<Blogit::Configuration:0x00000101cd62c8 @_config={:include_comments=>:disqus, :include_share_bar=>true, :twitter_username=>"@thejasonbuehler", :blogger_display_name_method=>:username, :datetime_format=>:short, :posts_per_page=>5, :ajax_comments=>true, :default_parser=>:markdown, :highlight_code_syntax=>true, :rss_feed_title=>"asdf", :rss_feed_description=>"Latest from asdf", :redcarpet_options=>{:hard_wrap=>true, :filter_html=>true, :autolink=>true, :no_intraemphasis=>true, :fenced_code_blocks=>true, :gh_blockcode=>true}, :layout=>"application", :active_states=>[:published], :hidden_states=>[:draft, :archive]}, @disqus_shortname=:somename>

In my initializer I have this: config.disqus_shortname = :somename

And the output from the configuration is: 2.0.0-p353 :001 > Blogit.configuration.disqus_shortname => nil

If I output my twitter_username in this way it works fine, but the disqus shortname isn't working. Any help would be appreciated. Thanks. Sweet gem.

jasonbuehler avatar Sep 18 '15 20:09 jasonbuehler

I think this is a bug caused by overwriting the accessor here:

    def disqus_shortname=(shortname)
      return if shortname.blank?
      unless include_comments == :disqus
        blogit_warn "You've set config.disqus_shortname in your blogit config file but " \
         "config.include_comments is not set to :disqus"
      end
      @disqus_shortname = shortname
    end

I'm not at my computer right now but you could try patching this by replacing @discuss_shortname = shortname with config.discuss_shortname = shortname

That might work

Bodacious avatar Sep 18 '15 22:09 Bodacious