Skip to content

Custom comment appears under the footer #2549

Closed
@sunete

Description

Environment

Expected behavior

I tried to custom comment. But the custom comment box appeared under the footer. What shuold I do to fix it?

Steps to reproduce the behavior

I tried to custom comment. The comments provider I used is valine comment. But when I added html code to the _includes\comments-providers\custom.html , the comment box appeared under the footer.

below

Other

I'm not very good at programming. Could you help me fix my code please?
Custom comment code in _includes\comments-providers\custom.html

<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<body>
    <div id="vcomments"></div>
    <script>
        new Valine({
            el: '#vcomments',
            appId: 'fBruNownJxl4LxbgbUmhSNbG-gzGzoHsz',
            appKey: 'iLHQpvO6X1Quor49czkLLi6m',
            visitor: true
        })
    </script>
</body>

Activity

iBug

iBug commented on Jun 1, 2020

@iBug
Collaborator

Duplicate of #2343.

sunete

sunete commented on Jun 1, 2020

@sunete
ContributorAuthor

I tried to run JEKYLL_ENV=production bundle exec jekyll build as you mentioned in the issue #2343 , but it didn't work. Then I tried to run shell below, the comment still in the wrong position like before. Is there any fault in my operation?

shell

iBug

iBug commented on Jun 2, 2020

@iBug
Collaborator

Your addition of an extra <body> tag looks erroneous. Perhaps you should try removing the wrong tags?

sunete

sunete commented on Jun 3, 2020

@sunete
ContributorAuthor

Even if I remove the body tag it still in the wrong position. I commited it to the repository so you can have a look.

My last commit: Enable custom comment for testing.

My website: Example of a comment box in the wrong positon.

Besides, I found that no matter what I added in custom.html , it would appear under the footer.For example, I only put <p>I have a cute cat.</p> in custom.html , this sentence will appear under the footer like before.
image.png

mmistakes

mmistakes commented on Jun 3, 2020

@mmistakes
Owner

The issue is /comments-providers/custom.html is for scripts only. This include is loaded after the footer.

You need to edit _includes/comments.html on this line and replace with comment HTML you need there. Probably the easier thing would be to drop in your scripts there too and forget about /comments-providers/custom.html

added a commit that references this issue on Jul 8, 2020
0b5c194
added a commit that references this issue on Jan 4, 2021
e74e0f3
added a commit that references this issue on Sep 4, 2023
aba3099
added a commit that references this issue on Sep 18, 2023
fbec3da
added a commit that references this issue on Jan 29, 2024
3ab6ba0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @mmistakes@iBug@sunete

      Issue actions

        Custom comment appears under the footer · Issue #2549 · mmistakes/minimal-mistakes