Blogdown 帖子出现在 RStudio 中但未出现在 Github 页面上

Blogdown posts appearing in RStudio but not on Github Pages

我正在尝试在 Github 页面和 运行 上部署一个内置 blogdown 的网站,解决一些内容在实时版本中导致 404 的问题,但在工作室。

可以查看部署的页面here, and the source for it is viewable on Github

相关页面位于 https://dshkol.github.io/2017/08/30/starting-a-blog/ - 打开会产生 404 错误。在 RStudio 中使用 blogdown::serve_site 启动时,此页面呈现良好。

重要的是,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   

以及相关的 Hugo 详细信息:

> Sys.which('hugo')
hugo 
  "" 
> blogdown:::find_hugo()
[1] "/Users/dshkol/Library/Application Support/Hugo/hugo"
> blogdown::hugo_version()
[1] ‘0.26’

截至提交 7da94409016057580648c15c7f7cb9886ad4d6a1,您尚未将 post 2017/08/30/starting-a-blog/index.html 推送到您的 Github 存储库。如果您通过 Github 页面部署,您应该提交并推送 public/ 文件夹中的所有内容。

正如我在 the blogdown book, you are recommended to deploy via Netlify instead of Github Pages, unless you can justify the latter (personally I don't see a single reason why one should still use Github Pages for building websites; here is another shout-out 中所写的那样。