eddiesigner / liebling

Beautiful and clean Ghost theme that is easy and comfortable to use. To get the latest version please head over the releases page šŸ‘‰šŸ¼
https://github.com/eddiesigner/liebling/releases
MIT License
1.27k stars 602 forks source link

Discourse Comments Error #308

Closed gladiator51 closed 3 years ago

gladiator51 commented 3 years ago

Hi, first just wanted to say this is an amazing theme - the elegance and code quality is some of the best I've ever seen.

One issue I'm having is trying to integrate discourse comments into the bottom of posts, and while I've gotten an "okay" solution, its still not right.

Essentially if I use the disquis solution, substitute in discourse code, and implement I successfully get a working button and comment frame - however it will only display the first reply (and no more) and the link to discourse saying "1 reply" is non-functional. In trying to isolate the error, I can comment out the the entire section class "m-comments" that loads the button and iframe which results in successfully pulling and displaying all replies from the forum, however at the cost of not being formatted correctly (full widescreen). I'm guessing its an issue with the iframe, but I'm beyond my experience Any ideas on how where my mistake is?

Ideally I'd like to use the button/frame setup, but its odd how its limited.

`

{{!-- If you want to embed comments, this is a good place to do it! --}}

    <section class="m-comments">
            <div class="m-load-comments">
              <div class="m-load-comments__line"></div>
              <button class="m-icon-button filled as-load-comments js-tooltip js-load-comments" data-tippy-content="Load comments">
                <span class="icon-comments"></span>
              </button>
            </div>
           <div class="m-load-comments__iframe l-wrapper in-comments js-comments-iframe">

              <div id='discourse-comments'></div>
        <script type="text/javascript">
         if (window.location.pathname.indexOf('/p/') < 0) {
           DiscourseEmbed = { 
                     discourseUrl: 'https://investorcommunity.org/',
                     discourseEmbedUrl: '{{url absolute="true"}}' 
                  }; 
                  (function() {
            var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
            d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
           })();
        }
          </script>
            </div>

          </section>
      {{/post}}

` Example of what it looks like with a test instance:

image

eddiesigner commented 3 years ago

Hi, thanks for the kind words, I appreciate it!

I guess this is because the comments area is hidden by default, I decided to display the comments without having to click a button first, that should fix this issue. Please download the latest version and try again.

eddiesigner commented 3 years ago

I'm closing this issue now, please feel free to reopen it if needed.