1

I read this post and the blogdown documentation, but I can't seem to find a relevant answer for my case.

EDIT: I found this blog post describing a workaround using build_site(method="custom"). I needed to change a few things (from md to html in some parts, since the knitted final format is html in my case). It seems to work for simple Rmds, but fancy interactive plots requiring htmlwidgets don't render correctly.

I recently switched from Wordpress to Hugo and I have a shared server for hosting my website. I'm trying to understand the best workflow to push updates. I'm using blogdown::build_site() command to create a publication-ready website, but it re-renders all the old Rmd posts taking extra time. How can I set it up so it only recreates new or edited files? If I was using Netlify route, it would be pretty straightforward due to version control and server-side hugo function, but I don't know how to implement a similar solution for self-hosting.

Also in this context, what is a good workflow for dealing with blogdown sites on shared server space? I'm trying to use WinSCP FTP synchronization feature, but it needs to compare all the files and takes forever. It is not possible to sync only edited or new files as far as I know.

Atakan
  • 342
  • 1
  • 13

1 Answers1

2

Basically I'm repeating the documentation and my answer in the post you mentioned:

  1. Do not use blogdown::build_site() (again, you rarely need to use this function).

  2. Use blogdown::serve_site() to (continuously) preview the site.

  3. When you are ready to publish the site, run blogdown::hugo_build(), and publish the public/ directory.

I hope it is clear this time.

Yihui Xie
  • 22,808
  • 20
  • 167
  • 387
  • 1
    Thanks. I think I was confused by serve_site updating the urls for local viewing and thought it will not be fixed by hugo_build. I'll use this approach. Thanks so much for the awesome package! – Atakan Jun 22 '20 at 17:31
  • 1
    It's my great pleasure. Thanks for your patience! – Yihui Xie Jun 22 '20 at 19:37