Closed zdebruine closed 3 years ago
I can't reproduce your problem:
> blogdown::build_site()
Start building sites …
hugo v0.88.1+extended darwin/amd64 BuildDate=unknown
| EN
-------------------+-----
Pages | 51
Paginator pages | 0
Non-page files | 47
Static files | 17
Processed images | 34
Aliases | 16
Sitemaps | 1
Cleaned | 0
Total in 536 ms
Do you have anything suspicious in your global ~/.Rprofile
? And what does blogdown:::site_root()
return?
Thanks for the help @yihui!
blogdown:::site_root()
is returning one level lower than the directory of the blog (i.e. C:/Users/Owner/Desktop
) instead of C:/Users/Owner/Desktop/blogdownsite.com
).
So I tried adding options(blogdown.site_root = "C:/Users/Owner/Desktop/blogdownsite.com")
to my ~/.Rprofile file, but after restarting R that didn't change the output of blogdown:::site_root()
or fix the issue with not finding config.yaml
.
This is my ~/.Rprofile
file:
if (file.exists("~/.Rprofile")) {
base::sys.source("~/.Rprofile", envir = environment())
}
options(
blogdown.serve_site.startup = FALSE,
blogdown.knit.on_save = TRUE,
blogdown.method = 'html'
)
options(blogdown.hugo.version = "0.88.1")
Thanks again for the help!
I mean ~/.Rprofile
(i.e., the one under your home directory), not the .Rprofile
in your project (I can see the latter in your repo).
xfun::file_string('~/.Rprofile')
Here is my Rprofile.site
file contents:
options(help_type="html")
blogdown:::site_root()
is returning one level lower than the directory of the blog (i.e.C:/Users/Owner/Desktop
) instead ofC:/Users/Owner/Desktop/blogdownsite.com
).
I moved config.yaml
to the current blogdown:::site_root()
which is C:/Users/Owner/Desktop
and now the site builds. But I would like to change the site_root()
to C:/Users/Owner/Desktop/blogdownsite.com
, however this hasn't worked using options(blogdown.site_root = "C:/Users/Owner/Desktop/blogdownsite.com")
. How else do I do this?
Related: https://community.rstudio.com/t/blogdown-serve-site-from-subdirectory/94658
That's really weird. I can't think of a reason why find_config()
couldn't find config.yaml
, and have to ask a few extra questions:
How did you open the project? I assume that you opened zachdebruine.com.Rproj
.
What's your working directory? i.e., getwd()
. I expect it to be C:/Users/Owner/Desktop/blogdownsite.com
if you did what I assumed in the first question.
How did you create this site? If you created it using the RStudio wizard or blogdown::new_site()
, you must have an index.Rmd
in the root dir like this: https://github.com/rbind/yihui/blob/master/index.Rmd But it should be fine if it doesn't exist.
Before we figure out why, I don't recommend that you try options(blogdown.site_root)
. It should be rare for general users to have to set this option.
zachdebruine.com.Rproj
getwd()
is C:/Users/Owner/Desktop/blogdownsite.com
.blogdown::new_site()
. index.md
exists in the /content
directory, I think that's due to the wowchemy theme?It always worked as expected, but I must have changed something in the last two days. I could try starting over with the site and copying the posts across, but I'm not eager to do that.
I don't get why the root directory is one level higher than the site directory. It shouldn't be. Where is the root directory set?
I think I've got it. I started a new blogdown site, copied over all files except config.yaml
, added in just the theme and modules to the new config.yaml
file from the old one, and now the site is building as normal. Something else in config.yaml
must have been causing the trouble, and I haven't yet figured out what it was.
Sorry for the bother, but I'm happy to be back up and running.
Okay, I'm glad that the problem is gone, although we don't know what happened :)
Note: Duplicate of this StackO post.
I have a blogdown site built with Hugo that I last successfully served with blogdown two days ago. Yesterday, when I tried to build a post again (without having changed anything else in the meantime) I got shot this error:
Well, here is the result of list.files() in my working directory:
Note the conspicuous presence of
config.yaml
.Note that this issue is not isolated to
blogdown::build_site()
-- any Rstudio add-in function provided by blogdown returns the same issue.Here is my
SessionInfo()
:If it's worth anything, here's a link to my blog source files: https://github.com/zdebruine/zachdebruine.com In fact, if you download the .zip, unzip it, and open up the Rstudio project, you'll get the same error from blogdown on attach.