在 Netlify 上部署后,Blogdown 站点未显示我的图像

时间:2021-06-14 20:48:34

标签: r rstudio netlify hugo blogdown

更新 Blogdown 包 (1.3.2) 和 Hugo 版本 0.79.0 后,我的 .html 文件由 .Rmd 文件生成。图像现在具有此字符串:{{< blogdown/postref >}} 之前不存在。见下面的例子。

<p><img src="{{< blogdown/postref >}}index.en_files/figure-html/unnamed-chunk-5-1.png" width="432" style="display: block; margin: auto;" /></p>

然后,部署在 Netlify 上的站点,没有显示 .Rmd 文件的图像。

这是我的 Github 存储库的链接:https://github.com/FranciscoPiccolo/franciscopiccolo.github.io

网页链接:https://franciscopiccolo.netlify.app/post/2019-09-05-residual-analysis-in-econometric-models/

检查网站输出:

> 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.toml
| Checking "baseURL" setting for Hugo...
○ Found baseURL = "https://francisco.piccolo.com/"; nothing to do here!
| 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.toml

― Checking .gitignore
| Checking for items to remove...
○ Nothing to see here - found no items to remove.
| Checking for items to change...
● [TODO] Change items in .gitignore: resources -> /resources
| Checking for items you can safely ignore...
○ Found! You have safely ignored: .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...
○ Great! Did not find such files.
― Check complete: .gitignore

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

― Checking netlify.toml...
○ Found HUGO_VERSION = 0.79.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.79.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...
○ Found 0 files with future publish dates.
● [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

1 个答案:

答案 0 :(得分:0)

那是因为您修改了 this commit 中的文件 postref.html 并向其添加了 EOL。该文件不能有 EOL。要解决此问题,请在 R 控制台中运行:

blogdown:::create_shortcode('postref.html', 'blogdown/postref', force = TRUE)