代码之家  ›  专栏  ›  技术社区  ›  user8215542

无法在我的网站上获得论文评论(jekyll)

  •  0
  • user8215542  · 技术社区  · 8 年前

    _布局/default.html

    <!DOCTYPE html>
    <html lang="en-us">
    
      {% include head.html %}
    
      <body>
        {% include google_analytics.html %}
        {% include sidebar.html %}
    
        <!-- Wrap is the content to shift when toggling the sidebar. We wrap the
             content to avoid any CSS collisions with our real content. -->
        <div class="wrap">
          <div class="masthead">
            <div class="container">
              <h3 class="masthead-title">
                <a href="{{ site.baseurl }}/" title="Home">{{ site.title }}</a>
                <small>{{ site.tagline }}</small>
              </h3>
            </div>
          </div>
    
          <div class="container content">
            {{ content }}
            {% include comments.html %}
          </div>
        </div>
    
        <label for="sidebar-checkbox" class="sidebar-toggle"></label>
    
        <script>
          (function(document) {
            var toggle = document.querySelector('.sidebar-toggle');
            var sidebar = document.querySelector('#sidebar');
            var checkbox = document.querySelector('#sidebar-checkbox');
    
            document.addEventListener('click', function(e) {
              var target = e.target;
    
              if(!checkbox.checked ||
                 sidebar.contains(target) ||
                 (target === checkbox || target === toggle)) return;
    
              checkbox.checked = false;
            }, false);
          })(document);
        </script>
      </body>
    </html>
    

    {% if page.comments %}
      <!-- Add Disqus comments. -->
      <div id="disqus_thread"></div>
      <script type="text/javascript">
          /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
          var disqus_shortname = 'yathartha22-github-io'; // required: replace example with your forum shortname
          var disqus_identifier = "{{ site.disqusid }}{{ page.url | replace:'index.html','' }}"
          /* * * DON'T EDIT BELOW THIS LINE * * */
          (function() {
              var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
              dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
              (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
          })();
      </script>
      <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
      <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
    {% endif %}
    

    我在这两个文件中进行了修改,以使DISKS集成,但我无法获取它。谁能帮帮我吗。我甚至做了 comments = true 在每个岗位上。这是 link 到我的博客

    1 回复  |  直到 8 年前
        1
  •  0
  •   marcanuy    8 年前

    修正包含在 _includes/comments.html :

    {% if page.comments %}
    <div id="disqus_thread"></div>
    <script type="text/javascript">
    /* * * CONFIGURATION VARIABLES * * */
    var disqus_shortname = 'yathartha22-github-io' ;
    
     /* * * DON'T EDIT BELOW THIS LINE * * */
     (function() {
       var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
       dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
       (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
     })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    {% endif %}
    

    index.html 更改生成帖子链接的方式:

    改变

      <a href="{{ site.baseurl }}/{{ post.url }}">
    

      <a href="{{ post.url | absolute_url}}">
    

    Discus评论不会出现在主页帖子列表中,但会出现在每个帖子中,因此在每个帖子内,你都会看到评论框,例如这里 http://localhost:4000/gsoc-preparation https://yathartha22.github.io/gsoc-preparation