rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 335 forks source link

can't serve_site() with /data folder containing some other files #287

Closed heavenzone closed 6 years ago

heavenzone commented 6 years ago

最近重装了系统,R和Rstudio都重装了,然后好像blogdown也升级了一下,突然发现blogdown:::serve_site()没效果,什么提示都没有,由于这个时候安装的hugo版本是0.37.1,我猜会不会是hugo新版本问题,于是复制了原来的0.32.1版本,也尝试了试用netlify上面设置的0.36.1版本,发现问题依旧,但是添加post之后push到github,发现netlify是可以正常deploy的,输入warnings()查看错误如下:

> blogdown::hugo_version()
[1] ‘0.36.1’
> blogdown:::serve_site()
> 
> warnings()
Warning messages:
1: running command '"C:\Users\krup\AppData\Roaming\hugo\hugo.exe" -b / -D -F -d "public" -t blackburn-krup' had status 65535
2: running command '"C:\Users\krup\AppData\Roaming\hugo\hugo.exe" -b / -D -F -d "public" -t blackburn-krup' had status 65535
3: running command 'C:\WINDOWS\system32\cmd.exe /c "C:\Users\krup\AppData\Roaming\hugo\hugo.exe" -b / -D -F -d "public" -t blackburn-krup' had status 1

我在猜会不会是content文件夹下的一些rmd不能编译的问题,于是把全部rmd文档和html文档删除了,只留下了md文档,发现问题仍然存在。

接着尝试直接在power shell上调用hugo试了一下:

PS D:\projects\Github-Projects\krupsite> C:\Users\krup\AppData\Roaming\hugo\hugo.exe server
[?25lBuilding sites … ERROR 2018/03/29 14:29:21 Failed to read data from zhiweibiao.xlsx\zhiweibiao.xlsx: Data not supported for extension 'xlsx'
25h
                   | EN
+------------------+-----+
  Pages            | 148
  Paginator pages  |   1
  Non-page files   |   1
  Static files     |  24
  Processed images |   0
  Aliases          |   1
  Sitemaps         |   1
  Cleaned          |   0

Total in 94 ms
Watching for changes in D:\projects\Github-Projects\krupsite\{content,data,static,themes}
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

看到上面的错误信息后,原来我在/data下面放了csv和xlsx等文件,于是把data名称改成别的,blogdown:::serve_site()成功。

我知道data文件夹是hugo的特殊文件夹,但是以前一直在里面放了那些文件也是没问题的,难道真的是升级了blogdown的引起的?(当然我不用data文件夹放csv文件就什么问题都没有了。)

yihui commented 6 years ago

跟升级 blogdown 无关。请看 Hugo 文档:https://gohugo.io/templates/data-templates/

These files must be YAML, JSON, or TOML files (using the .yml, .yaml, .json, or .toml extension).