jhelvy / distillery

A distill blog and showcase about building distill websites and blogs!
http://distillery.rbind.io/
43 stars 30 forks source link

Add post on using giscus #75

Closed joelnitta closed 3 years ago

joelnitta commented 3 years ago

Should resolve #73.

I didn't touch _footer.html because I assume it should reflect whenever this is actually merged.

One thing I couldn't figure out: it seems that the HTML file for each post in _posts is named with the slug, not index.html, yet when they get built to _site they are named index.html (eg: named by slug here but index.html here). I tried manually changing mine to the slug, but it wasn't getting built as index.html so I left it as index.

jhelvy commented 3 years ago

Looking quickly at your post, I think the index thing might have to do with the use of the {refinery} package. I've never used it so I don't really know what it does, but it appears there is a slug parameter that might be how page slugs get created? Anyway, I'm not able to build your post on my end as I don't have {refinery} installed, but it looks like the index.html file is good, so I'll merge the PR.

joelnitta commented 3 years ago

Thanks! I can confirm your hunch is right. Instead of distill::create_post(), I create posts using refinery::use_article_template(), which I now see automatically uses index.

BTW, {refinery} is a package in early development by @djnavarro that enables reproducible blog posts by the use of {renv}. I think it's pretty great, since it can be a pain to reproduce old blog posts once various packages have been updated.

Actually... {refinery} may be very useful in the particular case of this website! I gather that you are actually re-rendering each post instead of just importing the HTML via distill::import_post(). If those posts were created using {refinery}, you should be able to recreate them using the exact same set of packages (at the exact same versions) they were made with.

Also, I think @djnavarro's blog post on {refinery} would be a perfect addition to Tips and Tricks: https://blog.djnavarro.net/posts/2021-09-30_on-blogging-reproducibly/. Consider it nominated 😁

jhelvy commented 3 years ago

Yes, that all makes good sense. I haven't used distill::import_post() mostly because I want to insert the blockquote at the top crediting the original author, so I have to re-render the post anyway. Also, some posts were from blogdown sites, so I had to convert those to distill. @djnavarro's post is certainly on the list of posts to add!

djnavarro commented 3 years ago

I will eventually send a PR for that post, honest! 😁