Reputation: 11
I'm very new to html and css, so bear with me here. I'm starting a jekyll based blog, and I'm trying to add a Google comment box below each of my blog posts. It seems fairly straightforward according to several sites.
However, the comment box is not showing up on my page. I've redone my post layout out to figure out where I've gone wrong. I can see something loaded when I use the chrome development tools, but I can't see anything on my page. Here's the post I'm looking at: https://stutighiya.github.io/blog/2016/08/22/jackets
comments.html - included in my post.html layout:
<script src="https://apis.google.com/js/plusone.js"></script>
<div id="comments"></div>
<script>
gapi.comments.render('comments', {
href: window.location,
width: '624',
first_party_property: 'BLOGGER',
view_type: 'FILTERED_POSTMOD'
});
</script>
post.html layout
<html>
<head>
<title>{{ page.title }}</title>
<!-- link to main stylesheet -->
<link rel="stylesheet" type="text/css" href="/css/main.css">
</head>
<body>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/blog">Blog</a></li>
</ul>
</nav>
<div id="post">
<article>
<header class="header">
<h1>{{ page.title }}</h1>
<p class="meta">{{ page.date | date_to_string }}</p>
</header>
<section>
{{ content }}
</section>
</article>
{% include comments.html %}
</div>
{% include footer.html %}
</body>
</html>
I'm hoping it's something simple that I'm missing... All help is greatly appreciated!
UPDATE: The posted code works. I just hadn't synced yet on GitHub. If anyone else has this issue:
1. I was originally running into problems because I did not include comments in the right place. Mine were not explicitly before the footer, and so nothing showed up.
2. After fixing (1), I had trouble debugging because the comment box was not visible locally (when running 'jekyll serve'). I had to push the code to actually see the comment box, which in hindsight, makes sense.
Hopefully this helps someone else!
Upvotes: 0
Views: 384
Reputation: 11
The posted code works. I just hadn't synced yet on GitHub. If anyone else has this issue: 1. I was originally running into problems because I did not include comments in the right place. Mine were not explicitly before the footer, and so nothing showed up. 2. After fixing (1), I had trouble debugging because the comment box was not visible locally (when running 'jekyll serve'). I had to push the code to actually see the comment box, which in hindsight, makes sense.
Hopefully this helps someone else
Upvotes: 1