rstudio / blogdown

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

Proactively test Hugo themes #707

Open yihui opened 2 years ago

yihui commented 2 years ago

From https://github.com/rstudio/blogdown/issues/704#issuecomment-1119237429

Originally I was thinking of testing only a few themes in a GHA daily workflow:

themes = c(
  'hugo-apero/hugo-apero',
  'wowchemy/starter-hugo-academic',
  'wowchemy/starter-research-group',
  'yihui/hugo-prose'
)
for (theme in themes) {
  d = tempfile()
  dir.create(d)
  xfun::in_dir(d, {
    blogdown::new_site(theme = theme, serve = FALSE)
    blogdown::build_site(build_rmd = 'newfile')
  })
  unlink(d, recursive = TRUE)
}

But it may be a better idea to test all themes: https://github.com/gohugoio/hugoThemesSiteBuilder/blob/main/themes.txt and generate a "status" page that shows which themes work or do not work with blogdown. This page could be a simple (meaning a plain style) HTML page deployed along with https://pkgs.rstudio.com/blogdown/. We can save the results in the artifacts, and make the pkgdown workflow read and deploy the results.

yihui commented 2 years ago

While I was fixing another new_site() bug, I decided to add some tests. Now the themes I mentioned above will be tested during R CMD check in GHA, but not on a daily basis, nor have I tried to test all themes.

cderv commented 2 years ago

Oh cool.

For the final solution, do you want still want it to be as part of R CMD check in package tests/ or is this a workaround and a custom GHA workflow would be better ?

Just to know

yihui commented 2 years ago

What I'm hoping for is that we want to make sure a selected list of themes always work, so a daily action to check them would be nice, and the action should throw an error if any of these themes fail to work.

Then I also want a "status page" that shows the full list of themes and indicate which ones work or fail. It's fine if certain themes in the full list fail (i.e. the action doesn't need to throw an error).