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

Custom comment appears under the footer #2549

Closed
sunete opened this issue Jun 1, 2020 · 5 comments
Closed

Custom comment appears under the footer #2549

sunete opened this issue Jun 1, 2020 · 5 comments

Comments

@sunete
Copy link
Contributor

sunete commented Jun 1, 2020

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>
@iBug
Copy link
Collaborator

iBug commented Jun 1, 2020

Duplicate of #2343.

@sunete
Copy link
Contributor Author

sunete commented Jun 1, 2020

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
Copy link
Collaborator

iBug commented Jun 2, 2020

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

@sunete
Copy link
Contributor Author

sunete commented Jun 3, 2020

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
Copy link
Owner

mmistakes commented Jun 3, 2020

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

jesuswasrasta pushed a commit to jesuswasrasta/jesuswasrasta.github.io that referenced this issue Jul 8, 2020
Also add custom_scripts.html include for custom comment provider JavaScript that loads in the footer.

Close mmistakes#2549
mzaffran pushed a commit to mzaffran/mzaffran.github.io that referenced this issue Jan 4, 2021
Also add custom_scripts.html include for custom comment provider JavaScript that loads in the footer.

Close mmistakes#2549
kaitokikuchi pushed a commit to kaitokikuchi/kaitokikuchi.github.io that referenced this issue Sep 4, 2023
Also add custom_scripts.html include for custom comment provider JavaScript that loads in the footer.

Close mmistakes#2549
chukycheese pushed a commit to chukycheese/chukycheese.github.io that referenced this issue Sep 18, 2023
Also add custom_scripts.html include for custom comment provider JavaScript that loads in the footer.

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

No branches or pull requests

3 participants