(Blogdown) R Markdown Blog Post Doesn't Work

Viewed 89

I created a blogdown website by doing blogdown::new_site(). It appears that the Markdown posts work perfectly fine but the R Markdown posts do not appear when I preview my site with blogdown::serve_site(). The R Markdown post is written in a file called index.Rmd, but it doesn't appear in the website. All of the index.md files do appear as blog posts though. It should look like this. As you can see, there is a post from 2020, one from 2016, and one from 2015. For me, only the 2016 and 2015 posts appear as they are written in Markdown. The 2020 post does not appear for me as it is written in R Markdown.

Running blogdown::check_site() gave me this output:

> blogdown::check_site()
― Running a series of automated checks for your blogdown website project...
--------------------------------------------------------------------------------
○ A successful check looks like this.
● [TODO] A check that needs your attention looks like this.
| Let's check out your blogdown site!
--------------------------------------------------------------------------------
― Checking config.yaml
| Checking "baseURL" setting for Hugo...
● [TODO] Update "baseURL" to your actual URL when ready to publish.
| Checking "ignoreFiles" setting for Hugo...
○ "ignoreFiles" looks good - nothing to do here!
| Checking setting for Hugo's Markdown renderer...
○ All set! Found the "unsafe" setting for goldmark.
― Check complete: config.yaml

― Checking .gitignore
● [TODO] .gitignore was not found. You may want to add this.
― Checking Hugo
| Checking Hugo version...
○ Found Hugo. You are using Hugo 0.97.1.
| Checking .Rprofile for Hugo version used by blogdown...
○ blogdown is using Hugo 0.97.1 to build site locally.
― Check complete: Hugo

― Checking netlify.toml...
○ Found HUGO_VERSION = 0.97.1 in [build] context of netlify.toml.
| Checking that remote & local Hugo versions match...
○ It's a match! Local and remote Hugo versions are identical (0.97.1).
| Checking that Netlify & local Hugo publish directories match...
○ Good to go - blogdown and Netlify are using the same publish directory: public
― Check complete: netlify.toml

― Checking content files
| Checking for validity of YAML metadata in posts...
○ All YAML metadata appears to be syntactically valid.
| Checking for previewed content that will not be published...
○ Found 0 files with future publish dates.
○ Found 0 files marked as drafts.
| Checking your R Markdown content...
● [TODO] Found 1 R Markdown file to render:

  content/post/2020-12-01-r-rmarkdown/index.Rmd

  To render a file, knit or use blogdown::build_site(build_rmd = 'newfile')
○ All R Markdown output files are up to date with their source files.
| Checking for .html/.md files to clean up...
○ Found 0 duplicate .html output files.
○ Found 0 incompatible .html files to clean up.
| Checking for the unnecessary 'content/' directory in theme...
○ Great! Your theme does not contain the content/ directory.
― Check complete: Content

It says, "To render a file, knit or use blogdown::build_site(build_rmd = 'newfile')". So I ran blogdown::build_site(build_rmd = 'newfile'):

> blogdown::build_site(build_rmd = 'newfile')
Rendering content/post/2020-12-01-r-rmarkdown/index.Rmd... Quitting from lines 30-37 (index.Rmd)
Error in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj = ifelse(P$x <  :
  X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 12 could not be loaded
Calls: local ... eval_with_user_handlers -> eval -> eval -> pie -> text -> text.default
Execution halted
Error: Failed to render content/post/2020-12-01-r-rmarkdown/index.Rmd
Execution halted

Here is the output of xfun::session_info('blogdown'):

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Gentoo GNU/Linux

Locale:
  LC_CTYPE=en_CA.utf8       LC_NUMERIC=C
  LC_TIME=en_CA.utf8        LC_COLLATE=en_CA.utf8
  LC_MONETARY=en_CA.utf8    LC_MESSAGES=C
  LC_PAPER=en_CA.utf8       LC_NAME=C
  LC_ADDRESS=C              LC_TELEPHONE=C
  LC_MEASUREMENT=en_CA.utf8 LC_IDENTIFICATION=C

Package version:
  base64enc_0.1.3  blogdown_1.9     bookdown_0.26    bslib_0.3.1
  digest_0.6.29    evaluate_0.15    fastmap_1.1.0    fs_1.5.2
  glue_1.6.2       graphics_4.1.2   grDevices_4.1.2  highr_0.9
  htmltools_0.5.2  httpuv_1.6.5     jquerylib_0.1.4  jsonlite_1.8.0
  knitr_1.38       later_1.3.0      magrittr_2.0.3   methods_4.1.2
  mime_0.12        promises_1.2.0.1 R6_2.5.1         rappdirs_0.3.3
  Rcpp_1.0.8.3     rlang_1.0.2      rmarkdown_2.13   sass_0.4.1
  servr_0.24       stats_4.1.2      stringi_1.7.6    stringr_1.4.0
  tinytex_0.38     tools_4.1.2      utils_4.1.2      xfun_0.30
  yaml_2.3.5

Hugo version: 0.97.1

Finally, here is a repository for my website so you can test it for yourselves: https://github.com/Amarakon55/amarakon.com

0 Answers
Related