Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

cannot deploy r blogdown website on netlify

I am building my first site using r blogdown following Yihui's book. It succeeded in the first deployment on netlify. Then I tried to remove all example posts by deleting the folders of them which makes the contents an empty folder. With blogdown::build_site(), it returns:

                   | EN  
-------------------+-----
  Pages            |  7  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 11  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0 

After commit and push, I tried to deploy again to see it, but it failed with the following info

12:31:56 PM: Build ready to start
12:31:58 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
12:31:58 PM: build-image tag: v3.6.1
12:31:58 PM: buildbot version: 734b021f1afb208e332629f2580fef69fda9a3bc
12:31:58 PM: Building without cache
12:31:58 PM: Starting to prepare the repo for build
12:31:58 PM: No cached dependencies found. Cloning fresh repo
12:31:58 PM: git clone https://github.com/xiangli-xl/xiangli-xl.github.io
12:31:59 PM: Preparing Git Reference refs/heads/master
12:32:00 PM: Failing build: Failed to parse configuration
12:32:00 PM: Failed during stage 'Reading and parsing configuration files': 
Base directory does not exist: /opt/build/repo/xiangli-xl.github.io

: exit status 1
12:32:00 PM: Finished processing build request in 2.485909192s

How should I fix it? Thank you so much~

question from:https://stackoverflow.com/questions/65839556/cannot-deploy-r-blogdown-website-on-netlify

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Perhaps the issue is in your netlify.toml file. Comparing Yihui's netlify.toml here with yours here, it seems you don't need [context] (line 7) and [context.production] (line 12).

Regarding indentation TOML's documentation says: Indentation is treated as whitespace and ignored, so this shouldn't be causing the problem.

Yihui's netlify.toml file:

[build]
  command = "hugo"
  publish = "public"
[build.environment]
  HUGO_VERSION = "0.25.1"

[context.branch-deploy]
  command = "hugo -F -b $DEPLOY_PRIME_URL"

[context.deploy-preview]
  command = "hugo -F -b $DEPLOY_PRIME_URL"

[context.production.environment]
  HUGO_ENV = "production"

(Notice he's using a HUGO_VERSION number different than yours)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...