How to deploy the site on Github Pages?



I read Yihui's book and want to deploy my site on Github Pages.
Because of the directory for publishing named by public, seemingly Github cannot recognize the public directory.

In the book, the directory named by public is created by Hugo. Could I just change it name into docs to fit Github pages?
Or any alternative to solve it in an automatic way


It's a lot of tinkering to get right.

Create a repository on git hub and clone it to your local drive. Create a new project in rStudio.

Use the new post addin to create a post, the serve site addin to create all the subsidiary folders and the console blogdown::hugo_build() command to populate the public folder.

Your gitpages folder can be named anything, but you get only one github address. The workaround is to have an index.html in your github root that points to your different hugo site directories or redirects to a single one.

For example and lead to the same page.

For blogdown, I followed Yuhui's suggestion and worked with deployment via to