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

Adapting your utterances.html so that boxes don't appear on listings page after building site. #15

Open
EllaKaye opened this issue May 5, 2021 · 2 comments

Comments

@EllaKaye
Copy link

EllaKaye commented May 5, 2021

Hi Miles. Thank you so much for your handy micro blog post on getting utterances up and running on a distill site. I've adapted your utterances.html script for my blog and, sure enough, the comments are appearing on my posts. I've noticed, though, that if I hit the 'Build Website' button in RStudio, then an utterances comment box appears on the bottom of the posts listing page, I think because then the script gets added to _site/posts.html Is there any way to avoid that happening? Not sure if this is a distill issue or something that's related to your script. I don't know JavaScript, otherwise I'd see if I could figure it out myself!

@MilesMcBain
Copy link
Owner

Hi Ella,

I had a quick look at your site and I can't see anything obviously wrong. The javascript is just looking for a d-article element and appending the utterances script to the end of that. There definitely is one of those on the listings page, so if the utterances.html gets included in the listings html you will get the utterances comments.

The main question is why is that happening? Your config seems to appropriately tie that include to the distill_article output type. Something has glitched out.

I never use the build website button, so maybe RStudio is doing something differently to how I use it. To render my website I usually call rmarkdown::render_site. Does that make any difference?

@EllaKaye
Copy link
Author

EllaKaye commented May 6, 2021

Hi Miles,

Thank you so much for taking the time to look into my website and the issue and getting back to me so quickly 😄

Unfortunately using rmarkdown::render_site causes the same issue. However, if I don't try and build/render the site myself, but just let distill do its thing after a I save, knit or create a post, then everything seems to work fine - I get a comment on the new post but not on the listing page. I not sure if that workflow will be satisfactory, or whether I will actually ever need to build/render the site myself (I'm pretty new to distill, still figuring it out!)

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

No branches or pull requests

2 participants