Go into the project directory and run the command to make the project directory as a git repository.
git init .
git add .
git commit 'init project'
git remote add origin https://github.com/MingChen0919/blogdown-website-with-hugo-theme-learn.git
.Rmd
filesAll .Rmd
files should go to the content/ directory. When running the blogdown::server_site()
function, the .Rmd
files within content/ directory will get rendered and HTML files will be generated and copied to the publish directory.
By default, the publish directory is the public/ directory. However, when hosting a website on GitHub, GitHub can only recognize website files within the docs/ folder. We need to change the default publish directory from public/ to docs/.
Add the following line to the config.toml file to change the default publish directory.
publishDir = "docs"
After run the blogdown::server_site()
function and push all commits to GitHub, go to the github repository, click settings, find the GitHub Pages section, and then select master branch /docs folder and save.