Livereload/serve_site 仅适用于默认的 blogdown 主题 hugo-lithium

Livereload/serve_site only works in default blogdown theme hugo-lithium

编辑:调查问题后,我简化了这个问题。

此问题是,对于除 hugo-lithium 之外的所有主题,除非我重新启动 r studio 会话并为网站提供服务,否则对网站的更改不会在查看器窗格或扩展中刷新 window。使用详细设置,命令 window 显示编织后没有内容呈现。我相信渲染会在重新启动时发生,但命令 window 会关闭,所以我没有该文档。重新启动和服务需要一秒钟,所以我正在考虑使用此解决方法,以便我可以使用我想要的主题。

R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

 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...
○ Found baseURL = ""; nothing to do here!
| Checking "ignoreFiles" setting for Hugo...
● [TODO] Add these items to the "ignoreFiles" setting: "\.knit\.md$", "\.utf8\.md$"
| Checking setting for Hugo's Markdown renderer...
○ All set! Found the "unsafe" setting for goldmark.
― Check complete: config.yaml

― Checking .gitignore
| Checking for items to remove...
○ Nothing to see here - found no items to remove.
| Checking for items to change...
○ Nothing to see here - found no items to change.
| Checking for items you can safely ignore...
● [TODO] You can safely add to .gitignore: .DS_Store, Thumbs.db
| Checking for items to ignore if you build the site on Netlify...
● [TODO] When Netlify builds your site, you can safely add to .gitignore: /public/, /resources/
| Checking for files required by blogdown but not committed...
● [TODO] Found 1 file that should be committed in GIT:

  layouts/shortcodes/blogdown/postref.html
― Check complete: .gitignore

― Checking Hugo
| Checking Hugo version...
○ Found Hugo. You are using Hugo 0.81.0.
| Checking .Rprofile for Hugo version used by blogdown...
| Hugo version not set in .Rprofile.
● [TODO] Set options(blogdown.hugo.version = "0.81.0") in .Rprofile and restart R.
― Check complete: Hugo

― Checking netlify.toml...
○ Found HUGO_VERSION = 0.81.0 in [build] context of netlify.toml.
| Checking that Netlify & local Hugo versions match...
○ It's a match! Blogdown and Netlify are using the same Hugo version (0.81.0).
| 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...
● [TODO] Found 1 file with a future publish date:

  content/event/example/index.md

  If you want to publish today, change a file's YAML key to 'date: 2021-03-25'
● [TODO] Found 2 files marked as drafts. To un-draft, run the command:

  blogdown::edit_draft(c(
  "content/privacy.md",
  "content/terms.md"
  ))

  and change a file's YAML from 'draft: true' to 'draft: false' or delete it
| Checking your R Markdown content...
○ All R Markdown files have been knitted.
○ 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

哇,我终于可以回答这个问题了!事实证明,我的工作目录位于 google 驱动器中是问题所在。由于它适用于hugo-lithium,所以我没有想到。我不知道为什么 hugo-lithuim 可以工作而其他人不能。希望这对可能遇到同样问题的其他人有所帮助。