rstudio / blogdown
Showing 1 of 3 files from the diff.
Other files ignored by Codecov
NEWS.md has changed.
DESCRIPTION has changed.

@@ -331,6 +331,11 @@
Loading
331 331
      # post-process go.mod so that users don't need to install Go (it sounds
332 332
      # unbelievable that a user needs to install Go just to use a Hugo theme)
333 333
      download_modules(file.path(expdir, 'go.mod'))
334 +
      # delete figure shortcode that uses http resources on Windows:
335 +
      # https://github.com/rstudio/blogdown/issues/546#issuecomment-788253660
336 +
      if (is_windows()) xfun::gsub_dir(
337 +
        '\\{\\{< figure src="https?://.+ >}}', '', dir = expdir, ext = 'md'
338 +
      )
334 339
      file.copy(list.files(expdir, full.names = TRUE), '../', recursive = TRUE)
335 340
    } else warning(
336 341
      "The theme has provided an example site. You should read the theme's documentation ",
@@ -379,15 +384,12 @@
Loading
379 384
      file.copy(list.files(theme, full.names = TRUE), '../', recursive = TRUE)
380 385
      unlink(theme, recursive = TRUE)
381 386
    }
382 -
    # themes may use config/_default/config.toml, e.g. hugo-academic; we need to
383 -
    # move this config to the root dir, because blogdown assumes the config file
384 -
    # is under the root dir
385 -
    if (file.exists(cfg <- file.path('..', 'config', '_default', 'config.toml'))) {
386 -
      file.rename(cfg, '../config.toml')
387 -
      unlink('../config.yaml')
388 -
    }
389 -
    # remove the themesDir setting; it is unlikely that you need it
390 -
    in_dir('..', change_config('themesDir', NA))
387 +
    in_dir('..', {
388 +
      # move the possible config/_default/config.toml to the root dir
389 +
      move_config()
390 +
      # remove the themesDir setting; it is unlikely that you need it
391 +
      change_config('themesDir', NA)
392 +
    })
391 393
  })
392 394
  if (is_theme) if (update_config) {
393 395
    change_config('theme', sprintf('"%s"', theme))
@@ -447,6 +449,27 @@
Loading
447 449
  unlink(with_ext(mod, c('.mod', '.sum')))
448 450
}
449 451
452 +
# themes may use config/_default/config.toml, e.g. hugo-academic; we need to
453 +
# move this config to the root dir, because blogdown assumes the config file
454 +
# is under the root dir
455 +
move_config = function() {
456 +
  f1 = config_files()
457 +
  f2 = file.path('config', '_default', f1)
458 +
  if (!any(i <- file_exists(f2))) return()
459 +
  file.rename(f2[i], f1[i])
460 +
  # delete config.yaml if config.toml exists
461 +
  if (length(f1) >= 2 && file_exists(f1[1])) unlink(f1[2])
462 +
  # delete `disable: true` in wowchemy's config:
463 +
  # https://github.com/rstudio/blogdown/issues/546#issuecomment-788253660
464 +
  if (file_exists(f1[2])) {
465 +
    x = read_utf8(f1[2])
466 +
    if (length(i <- grep('path: github.com/wowchemy/wowchemy-hugo-modules/wowchemy-cms', x))) {
467 +
      i = i[1]
468 +
      if (grepl('^\\s+disable: true', x[i + 1])) write_utf8(x[-(i + 1)], f1[2])
469 +
    }
470 +
  }
471 +
}
472 +
450 473
#' @param path The path to the new file under the \file{content} directory.
451 474
#' @param kind The content type to create, i.e., the Hugo archetype. If the
452 475
#'   archetype is a page bundle archetype, it should end with a slash, e.g.,
Files Coverage
R 11.35%
Project Totals (11 files) 11.35%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading