Karsten W.
Karsten W.

Reputation: 18420

blogdown::serve_site, error copying static files

I am trying to build a website using blogdown in RStudio.

I chose "New Project", "New Directory", "Website using blogdown", picked a name for the directory and left all other options the default. As expected, a nice directory structure with examples got created.

However, when I run serve_site() I get two times the same error messages:

Error: Error copying static files: chtimes <mypath>\public\: Wrong Parameter.

and then

The system can not find the specified path.

(own translations, <mypath> is an existing path).

I suspected that some entries in config.toml need to be adjusted and placed two files logo.png and favicon.ico into the static directory. This did not help.

Then I thought maybe the baseurl entry needs a different value than /. However, blogdown:::site_root() returns the correct folder.

It seems not to be an RStudio / blogdown problem, since if I enter the command

hugo.exe -b / -D -F -d "public" --themesDir themes -t hugo-lithium

at the command prompt in the project directory, the same error is returned.

Any ideas are very appreciated...

(I am on Windows 10, using RStudio 1.3.1073, R 4.0.2, and Hugo 0.75.1)

Upvotes: 2

Views: 406

Answers (1)

Karsten W.
Karsten W.

Reputation: 18420

I found the answer outside of Stackoverflow. The problem seems to be that the folder is on an exFAT external drive. By adding --noTimes, everything works fine:

hugo.exe -b / -D -F -d "public" --themesDir themes -t hugo-lithium --noTimes

Another option, which works probably better for me, is to to specify publishDir in the config.toml as subdirectory of my Documents folder. The command then changes to

hugo.exe -D -F --themesDir themes -t hugo-lithium

and it works even within RStudio.

With blogdown >= v1.1, the --noTimes argument can be specified in:

blogdown::hugo_build(args = "--noTimes")

You can also set it in the global option in your .Rprofile:

options(blogdown.hugo.args = "--noTimes")

so you would only need to call blogdown::hugo_build().

Upvotes: 2

Related Questions