rogtemplate is a private pkgdown template for core rOpenGov package sites. It provides site setup helpers, package asset helpers and rOpenGov color palettes.
Please do not use it for your own code.
You can deploy your pkgdown site with rogtemplate through a GitHub Actions workflow or build it locally. The workflow runs automatically after setup. A local build gives you more control.
You do not need to install rogtemplate itself. First, copy this
workflow
file
to your .github/workflows/ folder.
Then go to YOUR_GITHUB_REPO > Settings > Pages and configure
GitHub Pages to publish from the gh-pages branch.
You can install rogtemplate from r-universe:
install.packages("rogtemplate",
repos = c("https://ropengov.r-universe.dev", "https://cloud.r-project.org")
)You can also use the pak package:
pak::pak("ropengov/rogtemplate")Use rog_actions_pkgdown_branch() to set up the workflow described
above. The deployment is still performed by GitHub Actions.
To build your package locally into the docs folder, use:
rogtemplate::rog_build()
# or use
rogtemplate::rog_add_template_pkgdown()
pkgdown::build_site()rogtemplate::rog_add_template_pkgdown() creates a _pkgdown.yml file
with these lines or adds them to an existing file:
template:
bootstrap: 5
package: rogtemplateThese lines tell pkgdown to use rogtemplate.
The last step is to commit to GitHub. If you use the GitHub Actions workflow, wait until it finishes, then configure GitHub Pages from YOUR_GITHUB_REPO > Settings > Pages.
rogtemplate also provides package asset helpers for badges, logos and fonts, plus rOpenGov color palettes. See the reference index for details.
