| Title: | 'pkgdown' Template for 'rOpenGov' Package Sites |
|---|---|
| Description: | A private pkgdown template for core rOpenGov packages. It provides site setup helpers, package asset helpers and rOpenGov color palettes. Please do not use it for your own code. |
| Authors: | Diego Hernangómez [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-8457-4658>), Steph Buongiorno [ctb] (ORCID: <https://orcid.org/0000-0002-6965-0787>) |
| Maintainer: | Diego Hernangómez <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2.9100 |
| Built: | 2026-07-17 11:15:43 UTC |
| Source: | https://github.com/rOpenGov/rogtemplate |
Create a GitHub Action workflow that builds a pkgdown site from
your package and deploys it to the gh-pages branch.
rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)
pkg |
Path to package. |
overwrite |
Overwrite the workflow if it already exists. |
The function is called for its side effects and returns
invisible(NULL).
site setup helpers:
rog_add_template_pkgdown(),
rog_build()
Add the rOpenGov template configuration to your _pkgdown.yml. If no
configuration file exists, create one at pkgdown/_pkgdown.yml. Also add the
corresponding paths to .Rbuildignore.
rog_add_template_pkgdown()rog_add_template_pkgdown()
The function also adds these package URLs to _pkgdown.yml and DESCRIPTION
if they are not already present:
https://ropengov.github.io/pkgname/
https://github.com/ropengov/pkgname
The function is called for its side effects and returns
invisible(NULL).
pkgdown vignettes:
vignette("pkgdown", package = "pkgdown") and
vignette("linking", package = "pkgdown"),
usethis's usethis::use_tidy_description().
site setup helpers:
rog_actions_pkgdown_branch(),
rog_build()
## Not run: rog_add_template_pkgdown() ## End(Not run)## Not run: rog_add_template_pkgdown() ## End(Not run)
Add an rOpenGov badge pointing to https://ropengov.org/ to your README:
rog_badge_ropengov(install = TRUE)rog_badge_ropengov(install = TRUE)
install |
|
The function is called for its side effects and returns NULL
invisibly.
usethis's usethis::use_badge().
package asset helpers:
rog_load_font(),
rog_logo()
rog_badge_ropengov(install = FALSE)rog_badge_ropengov(install = FALSE)
A wrapper around pkgdown's pkgdown::build_site().
rog_build(pkg = ".", ...)rog_build(pkg = ".", ...)
pkg |
Path to package. |
... |
Arguments passed to |
This function also calls rog_add_template_pkgdown() and rog_logo().
The function is called for its side effects and returns
invisible(NULL).
pkgdown's pkgdown::build_site() and
rog_add_template_pkgdown().
site setup helpers:
rog_actions_pkgdown_branch(),
rog_add_template_pkgdown()
Load the current rOpenGov font, B612 Mono.
rog_load_font()rog_load_font()
The font family name, "B612 Mono".
package asset helpers:
rog_badge_ropengov(),
rog_logo()
rog_load_font()rog_load_font()
Creates a logo automatically with hexSticker's
hexSticker::sticker(). Optionally, create favicons with
pkgdown's pkgdown::build_favicons().
rog_logo( pkgname, filename = "man/figures/logo.png", p_x = 1, p_y = 1, p_size = 202.6 * nchar(pkgname)^-1.008, overwrite = FALSE, favicons = TRUE )rog_logo( pkgname, filename = "man/figures/logo.png", p_x = 1, p_y = 1, p_size = 202.6 * nchar(pkgname)^-1.008, overwrite = FALSE, favicons = TRUE )
pkgname |
Name of the package. If not supplied, the name is detected from DESCRIPTION. |
filename |
filename to save sticker |
p_x |
x position for package name |
p_y |
y position for package name |
p_size |
font size for package name |
overwrite |
Should the current logo be overwritten? When |
favicons |
Should favicons be created with pkgdown's
|
The function is called for its side effects and returns NULL
invisibly.
hexSticker's hexSticker::sticker(),
usethis's usethis::use_logo() and pkgdown's
pkgdown::build_favicons().
package asset helpers:
rog_badge_ropengov(),
rog_load_font()
tmp <- tempfile(fileext = ".png") rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE) # Display the logo. logo <- magick::image_read(tmp) logo plot(logo)tmp <- tempfile(fileext = ".png") rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE) # Display the logo. logo <- magick::image_read(tmp) logo plot(logo)
Color palettes based on the rOpenGov color scheme.
rog_orange_pal(n = 4, alpha = 0.9, rev = FALSE) rog_dark_pal(n = 4, alpha = 0.9, rev = FALSE) rog_gradient_pal(n = 4, alpha = 0.9, rev = FALSE) rog_qualitative_pal(n = 6, alpha = 0.9, rev = FALSE)rog_orange_pal(n = 4, alpha = 0.9, rev = FALSE) rog_dark_pal(n = 4, alpha = 0.9, rev = FALSE) rog_gradient_pal(n = 4, alpha = 0.9, rev = FALSE) rog_qualitative_pal(n = 6, alpha = 0.9, rev = FALSE)
n |
the number of colors ( |
alpha |
an alpha-transparency level in the range [0,1]
(0 means transparent and 1 means opaque), see argument
|
rev |
logical indicating whether the ordering of the colors should be reversed. |
Color palettes.
grDevices' grDevices::hcl.colors().
scales::show_col(rog_orange_pal(9)) scales::show_col(rog_dark_pal(9)) scales::show_col(rog_gradient_pal(9)) scales::show_col(rog_qualitative_pal(9))scales::show_col(rog_orange_pal(9)) scales::show_col(rog_dark_pal(9)) scales::show_col(rog_gradient_pal(9)) scales::show_col(rog_qualitative_pal(9))