Blogdown posts appearing in RStudio but not on Github Pages

473 views Asked by At

I'm trying to deploy a site built in blogdown on Github Pages and running into an issue where some content leads to a 404 in the live version, but works fine when served in RStudio.

The deployed page can be viewed here, and the source for it is viewable on Github.

The page in question is at https://dshkol.github.io/2017/08/30/starting-a-blog/ - opening which produces a 404 error. This page renders fine when launched using blogdown::serve_site in RStudio.

Importantly, all other sections of the blogdown page work in both RStudio and on Github Pages. This includes /Projects/, /Contact/, and /About/.

The site uses the Hugo Ghostwriter theme, which is one of the ones recommended in the blogdown documentation.

screenshot

Relevant(?) sections of the TOML file:

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

My session info:

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   

And relevant Hugo details:

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

There are 1 answers

2
Yihui Xie On BEST ANSWER

As of commit 7da94409016057580648c15c7f7cb9886ad4d6a1, you haven't pushed the post 2017/08/30/starting-a-blog/index.html to your Github repo yet. You should commit and push everything in the public/ folder if you deploy via Github Pages.

As I wrote in 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).