rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 334 forks source link

Unable to create new posts #752

Closed starship9 closed 1 year ago

starship9 commented 1 year ago

I am struggling to create new posts via blogdown. Everytime I attempt to create a new post, I get the following message:

Loading required package: shiny

Listening on http://127.0.0.1:4451
Warning in system2(...) :
  running command '"C:/Users/<PATH_NAME>/Hugo/0.112.3/hugo.exe" new "post/2023-05-25-test/index.md" --themesDir themes -t hugo-lithium' had status 1
Warning: Error in new_content: Failed to create the file 'post/2023-05-25-test/index.Rmd'.
  9: shiny::runApp
  8: shiny::runGadget
  7: eval
  6: eval
  5: sys.source
  2: source_addin
  1: blogdown:::new_post_addin

This is happening irrespective of site theme being used, even when I attempt to create a new website with a different theme. Additionally, using the default Lithium theme to create a new blogdown site leads to this:

Creating your new site
| Installing the theme yihui/hugo-lithium from github.com
trying URL 'https://github.com/yihui/hugo-lithium/archive/HEAD.tar.gz'
Content type 'application/x-gzip' length unknown
downloaded 109 KB

Error in gsub_file(f, ...) : 
  Unable to read or write to 687c340e18f2/hugo-lithium-ac5574669ddd07feb1cb87fab1f5933a45e3f578/exampleSite/content/post/2015-01-01-lorem-ipsum/index.md

I had 2 blogs which were made prior to the v1.0 blogdown update (I recently decided to start posting on them again), so I am unsure if it is a combination of changes behind the scenes combining with newer Hugo versions causing this. Initially I was getting build errors pointing to my partials (I was unable to use blogdown::serve_site(), so I replicated the partials from the GitHub repository of the Lithium theme, which removed these errors. I was unsure of where the error was exactly before.

Additionally, when I try blogdown::build_site(build_rmd = TRUE), every single (already existing) post of mine gets reknitted apart from the most recent one. blogdown::build_site(build_rmd='timestamp') simply gets stuck, leading me to end the process.

Session info for reference:

xfun::session_info('blogdown')
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621), RStudio 2023.3.1.446

Locale:
  LC_COLLATE=English_India.utf8  LC_CTYPE=English_India.utf8    LC_MONETARY=English_India.utf8
  LC_NUMERIC=C                   LC_TIME=English_India.utf8    

time zone: Europe/London
tzcode source: internal

Package version:
  base64enc_0.1.3   blogdown_1.17.2   bookdown_0.34     bslib_0.4.2       cachem_1.0.8      cli_3.6.1        
  digest_0.6.31     ellipsis_0.3.2    evaluate_0.21     fastmap_1.1.1     fontawesome_0.5.1 fs_1.6.2         
  glue_1.6.2        graphics_4.3.0    grDevices_4.3.0   highr_0.10        htmltools_0.5.5   httpuv_1.6.11    
  jquerylib_0.1.4   jsonlite_1.8.4    knitr_1.42        later_1.3.1       lifecycle_1.0.3   magrittr_2.0.3   
  memoise_2.0.1     methods_4.3.0     mime_0.12         promises_1.2.0.1  R6_2.5.1          rappdirs_0.3.3   
  Rcpp_1.0.10       rlang_1.1.1       rmarkdown_2.21    sass_0.4.6        servr_0.27        stats_4.3.0      
  stringi_1.7.12    stringr_1.5.0     tinytex_0.45      tools_4.3.0       utils_4.3.0       vctrs_0.6.2      
  xfun_0.39         yaml_2.3.7       

Hugo version: 0.112.3
yihui commented 1 year ago

Unfortunately the Hugo v0.112.x series are broken. The developer is still actively fixing the bugs, e.g., https://github.com/gohugoio/hugo/issues/11018 I strongly recommend against using Hugo v0.112.x. You may consider downgrading to 0.111.x:

blogdown::remove_hugo('0.112.3')
blogdown::install_hugo('0.111.3')

And remember to set the Hugo version in your .Rprofile and restart R.

starship9 commented 1 year ago

This worked! Thank you so much, my blog is building successfully now!