我正在尝试在 Github Pages 上部署一个内置 blogdown 的网站,并遇到一个问题,即某些内容在实时版本中导致 404,但在 RStudio 中提供时工作正常。
部署的页面可以在这里查看,它的源代码可以在Github上查看。
有问题的页面位于https://dshkol.github.io/2017/08/30/starting-a-blog/ - 打开会产生 404 错误。blogdown::serve_site
在 RStudio 中使用启动时,此页面呈现良好。
重要的是,blogdown 页面的所有其他部分都可以在 RStudio 和 Github 页面上使用。这包括 /Projects/、/Contact/ 和 /About/。
该站点使用 Hugo Ghostwriter 主题,这是 blogdown 文档中推荐的主题之一。
TOML 文件的相关(?)部分:
baseurl = "https://dshkol.github.io/"
publishDir = "../dshkol.github.io"
title = "dshkol blog"
theme = "ghostwriter"
languageCode = "en-us"
disqusShortname = "dshkol"
googleAnalytics = "XXX"
ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
[Taxonomies]
tag = "tags"
[Params]
intro = true
headline = "DSHKOL"
description = "Thoughts and words"
opengraph = true
shareTwitter = true
shareFacebook = true
shareGooglePlus = true
shareLinkedIn = false
dateFormat = "Mon, Jan 2, 2006"
highlightJsUrl = ""
highlightJsLocalUrl = ""
[Permalinks]
post = "/:year/:month/:day/:slug/"
[[menu.main]]
name = "Blog"
url = "/"
weight = 1
[[menu.main]]
name = "Projects"
url = "/project/"
weight = 2
[[menu.main]]
name = "Contact"
url = "/page/contact/"
weight = 3
[[menu.main]]
name = "About"
url = "/page/about/"
weight = 4
我的会话信息:
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_0.12.12 bookdown_0.5 digest_0.6.12 rprojroot_1.2 mime_0.5 backports_1.1.0
[7] magrittr_1.5 evaluate_0.10.1 blogdown_0.1.3 stringi_1.1.5 rmarkdown_1.6 tools_3.4.1
[13] servr_0.7 stringr_1.2.0 httpuv_1.3.5 compiler_3.4.1 htmltools_0.3.6 knitr_1.17
以及相关的雨果细节:
> Sys.which('hugo')
hugo
""
> blogdown:::find_hugo()
[1] "/Users/dshkol/Library/Application Support/Hugo/hugo"
> blogdown::hugo_version()
[1] ‘0.26’