Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem creating Project #665

Closed
pssguy opened this issue Nov 9, 2021 · 8 comments
Closed

Problem creating Project #665

pssguy opened this issue Nov 9, 2021 · 8 comments

Comments

@pssguy
Copy link

pssguy commented Nov 9, 2021

Been a while but creating a new blogdown project via RStudio results in an execution error

― Creating your new site
| Installing the theme yihui/hugo-lithium from github.com
trying URL 'https://github.com/yihui/hugo-lithium/archive/master.tar.gz'
Content type 'application/x-gzip' length unknown
downloaded 109 KB

| Adding the sample post to content/post/2020-12-01-r-rmarkdown.Rmd
| Converting all metadata to the YAML format
| Adding netlify.toml in case you want to deploy the site to Netlify
Error in write_toml(d, f) : Wrong TOML data generated by Hugo:

I'm using blogdown version 1.6.1
Creating without checking the netlify option does obviate the issue

@pssguy
Copy link
Author

pssguy commented Nov 10, 2021

Not sure if this is related to the above issue, but when I try and build the site

> blogdown::serve_site()
Launching the server via the command:
  C:/Users/Andrew/AppData/Roaming/Hugo/0.30.2/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-lithium -D -F --navigateToChanged
Serving the directory . at http://localhost:4321
Launched the hugo server in the background (process ID: 45664). To stop it, call blogdown::stop_server() or restart the R session.

There is no message

Rendering content/post/2020-12-01-r-rmarkdown/index.Rmd... Done.
``
and nothing appears visually in the editor

There is a 2020-12-01-r-rmarkdown.html created but I have to open and preview to see the endproduct

@yihui
Copy link
Member

yihui commented Nov 10, 2021

I'm using blogdown version 1.6.1

Please follow the issue guide to report xfun::session_info('blogdown'). The info you provided is too little for us to help or tell anything. Thanks!

@pssguy
Copy link
Author

pssguy commented Nov 11, 2021

Apologies

R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 2021.9.1.372

Locale:
  LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252    LC_MONETARY=English_Canada.1252
  LC_NUMERIC=C                    LC_TIME=English_Canada.1252    

Package version:
  base64enc_0.1.3  blogdown_1.6.1   bookdown_0.24    digest_0.6.28    evaluate_0.14    fastmap_1.1.0   
  glue_1.5.0       graphics_4.1.1   grDevices_4.1.1  highr_0.9        htmltools_0.5.2  httpuv_1.6.3    
  jquerylib_0.1.4  jsonlite_1.7.2   knitr_1.36       later_1.3.0      magrittr_2.0.1   methods_4.1.1   
  mime_0.12        promises_1.2.0.1 R6_2.5.1         Rcpp_1.0.7       rlang_0.4.12     rmarkdown_2.11  
  servr_0.23       stats_4.1.1      stringi_1.7.5    stringr_1.4.0    tinytex_0.35     tools_4.1.1     
  utils_4.1.1      xfun_0.27        yaml_2.2.1      

Hugo version: 0.30.2

@yihui
Copy link
Member

yihui commented Nov 11, 2021

It seems that Hugo 0.30.2 has a bug (gohugoio/hugo#2458) that was fixed in a later version (not sure which).

I might be able to fix this problem in blogdown, but would like to first ask if you are unable to use a higher version of Hugo.

@pssguy
Copy link
Author

pssguy commented Nov 11, 2021

I would not know why I would be unable to use a higher version. I'm guessing I have only ever installed Hugo as part of setting up a previous blogdown site: but that would have been some years ago.

@yihui
Copy link
Member

yihui commented Nov 11, 2021

Then I suggest you try a higher version of Hugo (0.30.2 is more than 4 years old now).

@pssguy
Copy link
Author

pssguy commented Nov 11, 2021

Thanks. Just in case there are others in the same boat this did the trick

blogdown::install_hugo()

To avoid this happening again, you might want to consider an update Hugo (as well as an install Hugo) as an option on creating a project
Thanks for your swift responses

@pssguy pssguy closed this as completed Nov 11, 2021
@yihui
Copy link
Member

yihui commented Nov 12, 2021

Just for the record, I figured out the minimal version of Hugo that can make blogdown::write_toml() work, which is v0.37.

remotes::install_github('rstudio/blogdown')
options(blogdown.hugo.version = NULL)

v1 = xfun::github_releases('gohugoio/hugo')
v2 = NULL  # failing versions
for (v in v1) {
  v3 = sub('v', '', v)
  if (as.numeric_version(v3) < '0.17') break
  blogdown::install_hugo(v)
  tryCatch(blogdown::config_netlify(NULL), error = function(e) v2 <<- c(v2, v))
  blogdown::remove_hugo(v3)
}
> v2
 [1] "v0.36.1" "v0.36"   "v0.35"   "v0.34"   "v0.33"   "v0.32.4" "v0.32.3" "v0.32.2" "v0.32.1" "v0.32"   "v0.31.1"
[12] "v0.31"   "v0.30.2" "v0.30.1" "v0.30"   "v0.29"   "v0.28"   "v0.27.1" "v0.27"   "v0.26"   "v0.25.1" "v0.25"  
[23] "v0.24.1" "v0.24"   "v0.23"   "v0.22.1" "v0.22"  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants