Blogdown on Rstudio Connect

blogdown
rstudioconnect

#1

Does anyone have a blogdown site where they are able to publish it to Rstudio Connect? I just started using Connect so I could be doing something totally wrong but my workflow has been:

  • Create the blogdown site
  • Go to the index.md
  • Click the publish button (which works for publishing reports in other directories)
  • Leave all the files it shows checked
  • Click publish

This leads to an error on Connect that says “Error in loadNamespace(name) : there is no package called ‘blogdown’”

I’m pretty confused by this but tried to be clever by trying bookdown::publish_book(render=‘server’) which led to the same error and bookdown::publish_book(render=‘local’) which ended up with me just having the blogdown index page with no styling and broken links.

I tried this with a proof of concept blog I have worked on as well as a brand new one created with blogdown:::blogdown_site() and had the same results with both.

Any advice would be greatly appreciated, it feels like it must be a minor issue somewhere but I’m completely at a loss and googling combinations of Rstudio connect and Blogdown mostly gets blogdown blogs about Rstudio or Rstudio blogs about Blogdown :joy:


#2

Have you tried to render the blog locally first and then push on RStudio Connect only the rendered site in the public folder ?
It would be as generating html locally from Rmd and publishing only the html on RStudio connect.


#3

Connect can host the final, rendered HTML of a blogdown site. (At this time it is not possible to publish the Rmd and have Connect render the site).

To do so, follow these steps (it is a narrow path to success that I’ve messed up a few times):

  1. Make sure you are in a RStudio project dedicated to the blog.
  2. Add relativeURLS=true to config.toml
  3. Develop as normal using blogdown::serve_site()
  4. When you’re ready to deploy, use the Build Pane’s Build Website command.

  1. Click Publish from the built preview, and select “Publish finished website only”


#4

Thanks @slopp, I finally had time to come back to this and your solution worked perfectly!!

Thanks to @cderv too! You definitely got me on the right path but I was missing the relativeURLS=true part and couldn’t figure out why all links lead me to 404s.


#5

Good to know! I did not thought about that for Connect. Thanks for the feedback!