无法使用Hugo和blogdown创建新文章。

huangapple go评论59阅读模式
英文:

Unable to create new posts with Hugo and blogdown

问题

I am here to assist with your translation request. Below is the translated content:

我在使用blogdown创建新文章时遇到了问题。每次尝试创建新文章时,都会出现以下消息:

加载必需的包:shiny

监听http://127.0.0.1:4451
警告:在system2(...)中运行命令 '"C:/Users/<PATH_NAME>/Hugo/0.112.3/hugo.exe" new "post/2023-05-25-test/index.md" --themesDir themes -t hugo-lithium' 时返回状态 1
警告:错误 in new_content: 无法创建文件 '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

不管使用哪种站点主题,都会出现这种情况,即使尝试使用不同主题创建新网站也是如此。此外,使用默认的Lithium主题会导致以下情况:

| 从github.com安装主题yihui/hugo-lithium
尝试URL 'https://github.com/yihui/hugo-lithium/archive/HEAD.tar.gz'
内容类型'application/x-gzip'长度未知
已下载109 KB

错误 in gsub_file(f, ...) : 
  无法读取或写入687c340e18f2/hugo-lithium-ac5574669ddd07feb1cb87fab1f5933a45e3f578/exampleSite/content/post/2015-01-01-lorem-ipsum/index.md

我之前有两个博客,这些博客是在v1.0 blogdown更新之前创建的(最近我决定重新开始发布文章),因此我不确定是幕后的更改与较新的Hugo版本结合在一起导致了这个问题。最初,我遇到了指向我的部分的构建错误(我无法使用blogdown::serve_site()),所以我从Lithium主题的GitHub存储库中复制了部分内容,以消除这些错误。在此之前,我不确定错误的确切位置。

此外,当我尝试blogdown::build_site(build_rmd = TRUE)时,我的每一篇(已存在的)文章都会重新渲染,除了最新的一篇。blogdown::build_site(build_rmd='timestamp')会导致卡住,导致我结束进程。

以下是参考的会话信息:

xfun::session_info('blogdown')
R版本4.3.0(2023-04-21 ucrt)
平台:x86_64-w64-mingw32/x64(64位)
运行环境:Windows 11 x64(版本22621),RStudio 2023.3.1.446

区域设置:
  LC_COLLATE=English_India.utf8  LC_CTYPE=English_India.utf8    LC_MONETARY=English_India.utf8
  LC_NUMERIC=C                   LC_TIME=English_India.utf8    

时区:Europe/London
tzcode源:internal

包版本:
  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版本:0.112.3

请告诉我如果您需要进一步的帮助。

英文:

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 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

答案1

得分: 1

这个链接是关于问题752的 GitHub 页面。

"这个问题已解决,我不得不降级我正在构建的 Hugo 版本。"

英文:

https://github.com/rstudio/blogdown/issues/752

This worked, I had to downgrade the version of Hugo I was building with.

huangapple
  • 本文由 发表于 2023年5月25日 21:30:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76332857.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定