下面对搭建过程做简单介绍。
new_site(
dir = 'blogdown_source',
theme = 'gcushen/hugo-academic',
format = 'toml', sample = FALSE, theme_example = TRUE)
publishDir tell blogdown which directory it should place the rendered site in. This directory will include a copy of everything that gets generated in the public/ directory of your site’s root directory. To use the two repository method described above, set this to publishDir = "../.github.io". Adjust this path to where ever you keep your .github.io repository
publishDir = "../jeevanyue.github.io"
config.toml文件里的默认设置不支持本地浏览,而且发布到网上时需要布署。这里改成相对路径relativeurls = true,就可以直接在本地打开 index.html 浏览了。
baseurl = "/"
relativeurls = true
blogdown::build_site()
## blogdown::build_dir('static')
部署到网站时再进行如下调整,注意baseurl不要缺失最后的左斜杠“/”。
baseurl = "https://jeevanyue.github.io/"
relativeurls = true
最后将eevanyue.github.io提交到GitHub。