Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disqus shortname is not being put into the page #79

Open
jasonbuehler opened this issue Sep 18, 2015 · 1 comment
Open

Disqus shortname is not being put into the page #79

jasonbuehler opened this issue Sep 18, 2015 · 1 comment

Comments

@jasonbuehler
Copy link

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.

@Bodacious
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants