I have solved the problem.
The problem is that my document has the configuration of draft: yes
, which makes it impossible to publish successfully.
The following are the specific steps to solve it.
By deleting the document that had the problem before and regenerating a new document using Rstudio.(I went through the process again.)
I found that the regenerated document will have this configuration: draft:yes
Through querying the hugo deployment-related documents: blogdown deployment post does not appear on the website,
I found that before pushing to my repository, I could check the site using the command: blogdown::check_site()
, And the inspection results will be output to the console , and there will be some simple suggestions in the TODO items
for example, this is my result after running the check command:
> 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.yaml
| Checking "baseURL" setting for Hugo...
○ Found baseURL = "https://liuzelin.netlify.app/"; nothing to do here!
| Checking "ignoreFiles" setting for Hugo...
● [TODO] Set "ignoreFiles" to ["\\.Rmd$", "\\.Rmarkdown$", "_cache$"]
| Checking setting for Hugo's Markdown renderer...
○ All set! Found the "unsafe" setting for goldmark.
― Check complete: config.yaml
― Checking index.Rmd in the root directory
○ index.Rmd is correctly configured.
― Check complete: index.Rmd
― 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...
○ Found! You have safely ignored: .DS_Store
● [TODO] You can safely add to .gitignore: Thumbs.db, .hugo_build.lock
| 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.100.2.
| Checking .Rprofile for Hugo version used by blogdown...
○ blogdown is using Hugo 0.100.2 to build site locally.
― Check complete: Hugo
― Checking netlify.toml...
○ Found HUGO_VERSION = 0.100.2 in [build] context of netlify.toml.
| Checking that remote & local Hugo versions match...
○ It's a match! Local and remote Hugo versions are identical (0.100.2).
| 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 1 file marked as drafts. To un-draft, run the command:
blogdown::edit_draft(c(
"content/posts/2024-06-16-supervisor/index.zh-cn.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
And i run the command that suggested above:
blogdown::edit_draft(c(
"content/posts/2024-06-16-supervisor/index.zh-cn.md"
))
delete the draft: yes
, and push to my repo, then deployed it successfully.
However, the draft parameter does not exist in the previously published documents.
The reason for this problem is that the recently created documents chose to use default.md
By checking default.md
, I found that there is a default configuration: draft: true
After I commented out the draft: true
configuration, I created a new document and published it again, and this problem will not occur.