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

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

Unable to create new posts with Hugo and blogdown

问题

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

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

  1. 加载必需的包:shiny
  2. 监听http://127.0.0.1:4451
  3. 警告:在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
  4. 警告:错误 in new_content: 无法创建文件 'post/2023-05-25-test/index.Rmd'。
  5. 9: shiny::runApp
  6. 8: shiny::runGadget
  7. 7: eval
  8. 6: eval
  9. 5: sys.source
  10. 2: source_addin
  11. 1: blogdown:::new_post_addin

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

  1. | github.com安装主题yihui/hugo-lithium
  2. 尝试URL 'https://github.com/yihui/hugo-lithium/archive/HEAD.tar.gz'
  3. 内容类型'application/x-gzip'长度未知
  4. 已下载109 KB
  5. 错误 in gsub_file(f, ...) :
  6. 无法读取或写入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')会导致卡住,导致我结束进程。

以下是参考的会话信息:

  1. xfun::session_info('blogdown')
  2. R版本4.3.02023-04-21 ucrt
  3. 平台:x86_64-w64-mingw32/x6464位)
  4. 运行环境:Windows 11 x64(版本22621),RStudio 2023.3.1.446
  5. 区域设置:
  6. LC_COLLATE=English_India.utf8 LC_CTYPE=English_India.utf8 LC_MONETARY=English_India.utf8
  7. LC_NUMERIC=C LC_TIME=English_India.utf8
  8. 时区:Europe/London
  9. tzcode源:internal
  10. 包版本:
  11. base64enc_0.1.3 blogdown_1.17.2 bookdown_0.34 bslib_0.4.2 cachem_1.0.8 cli_3.6.1
  12. digest_0.6.31 ellipsis_0.3.2 evaluate_0.21 fastmap_1.1.1 fontawesome_0.5.1 fs_1.6.2
  13. glue_1.6.2 graphics_4.3.0 grDevices_4.3.0 highr_0.10 htmltools_0.5.5 httpuv_1.6.11
  14. jquerylib_0.1.4 jsonlite_1.8.4 knitr_1.42 later_1.3.1 lifecycle_1.0.3 magrittr_2.0.3
  15. memoise_2.0.1 methods_4.3.0 mime_0.12 promises_1.2.0.1 R6_2.5.1 rappdirs_0.3.3
  16. Rcpp_1.0.10 rlang_1.1.1 rmarkdown_2.21 sass_0.4.6 servr_0.27 stats_4.3.0
  17. stringi_1.7.12 stringr_1.5.0 tinytex_0.45 tools_4.3.0 utils_4.3.0 vctrs_0.6.2
  18. xfun_0.39 yaml_2.3.7
  19. 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:

  1. Loading required package: shiny
  2. Listening on http://127.0.0.1:4451
  3. Warning in system2(...) :
  4. 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
  5. Warning: Error in new_content: Failed to create the file 'post/2023-05-25-test/index.Rmd'.
  6. 9: shiny::runApp
  7. 8: shiny::runGadget
  8. 7: eval
  9. 6: eval
  10. 5: sys.source
  11. 2: source_addin
  12. 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:

  1. Creating your new site
  2. | Installing the theme yihui/hugo-lithium from github.com
  3. trying URL 'https://github.com/yihui/hugo-lithium/archive/HEAD.tar.gz'
  4. Content type 'application/x-gzip' length unknown
  5. downloaded 109 KB
  6. Error in gsub_file(f, ...) :
  7. 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:

  1. xfun::session_info('blogdown')
  2. R version 4.3.0 (2023-04-21 ucrt)
  3. Platform: x86_64-w64-mingw32/x64 (64-bit)
  4. Running under: Windows 11 x64 (build 22621), RStudio 2023.3.1.446
  5. Locale:
  6. LC_COLLATE=English_India.utf8 LC_CTYPE=English_India.utf8 LC_MONETARY=English_India.utf8
  7. LC_NUMERIC=C LC_TIME=English_India.utf8
  8. time zone: Europe/London
  9. tzcode source: internal
  10. Package version:
  11. base64enc_0.1.3 blogdown_1.17.2 bookdown_0.34 bslib_0.4.2 cachem_1.0.8 cli_3.6.1
  12. digest_0.6.31 ellipsis_0.3.2 evaluate_0.21 fastmap_1.1.1 fontawesome_0.5.1 fs_1.6.2
  13. glue_1.6.2 graphics_4.3.0 grDevices_4.3.0 highr_0.10 htmltools_0.5.5 httpuv_1.6.11
  14. jquerylib_0.1.4 jsonlite_1.8.4 knitr_1.42 later_1.3.1 lifecycle_1.0.3 magrittr_2.0.3
  15. memoise_2.0.1 methods_4.3.0 mime_0.12 promises_1.2.0.1 R6_2.5.1 rappdirs_0.3.3
  16. Rcpp_1.0.10 rlang_1.1.1 rmarkdown_2.21 sass_0.4.6 servr_0.27 stats_4.3.0
  17. stringi_1.7.12 stringr_1.5.0 tinytex_0.45 tools_4.3.0 utils_4.3.0 vctrs_0.6.2
  18. xfun_0.39 yaml_2.3.7
  19. 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:

确定