-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
103 lines (72 loc) · 3.06 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
tidy = "styler",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# rogtemplate <a href='https://ropengov.github.io/rogtemplate/'><img src="man/figures/logo.png" align="right" height="139"/></a>
<!-- badges: start -->
[![rOG-badge](https://ropengov.github.io/rogtemplate//reference/figures/ropengov-badge.svg)](https://ropengov.org/)
[![R build
status](https://github.com/ropengov/rogtemplate/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenGov/rogtemplate/actions)
[![r-universe](https://ropengov.r-universe.dev/badges/rogtemplate)](https://ropengov.r-universe.dev/rogtemplate)
[![lifecycle](https://lifecycle.r-lib.org/articles/figures/lifecycle-experimental.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
This package is a **pkgdown** template adapted to
[rOpenGov](https://ropengov.org/) site.
This is a private template for use by core rOpenGov packages. Please don't use
it for your own code.
## Using rogtemplate
It is possible to deploy your **pkgdown** site along with **rogtemplate** via CI
(GitHub Actions) or locally, that provides more control but it is not automatic.
### Option A: Deploy using GitHub Actions
It is not necessary to install **rogtemplate** itself. First copy [this
file](https://github.com/rOpenGov/rogtemplate/blob/main/inst/yaml/rogtemplate-gh-pages.yaml)
into your `.github/workflows/` folder.
Next go to *YOUR_GITHUB_REPO\>Settings\>GitHub Pages* and deploy your website
from the `gh-pages` branch.
### Option B: Deploy installing rogtemplate
You can install **rogtemplate** using the
[r-universe](https://ropengov.r-universe.dev/rogtemplate):
```{r, eval=FALSE}
install.packages("rogtemplate",
repos = c("https://ropengov.r-universe.dev", "https://cloud.r-project.org")
)
```
You can use also the **remotes** package:
```{r, eval=FALSE}
library(remotes)
install_github("ropengov/rogtemplate", dependencies = TRUE)
```
You can use `rog_actions_pkgdown_branch()` for setting up the action described
before but the deployment would be still performed by a GitHub action.
For building locally your package into your `docs` folder use:
```{r, eval=FALSE}
rogtemplate::rog_build()
# or you can use also
rogtemplate::rog_add_template_pkgdown()
pkgdown::build_site()
```
Note that `rogtemplate::rog_add_template_pkgdown()` creates a `_pkgdown.yml`
file (or modify an existing one) with the following lines:
``` yaml
template:
bootstrap: 5
package: rogtemplate
```
These lines tells **pkgdown** to use **rogtemplate**.
## Commit to GitHub and deploy
Last step is commit to GitHub, wait until the GitHub action ends (in the case
you chose to deploy in that way) and deploy the website via
*YOUR_GITHUB_REPO\>Settings\>GitHub Pages*.
## Extras
We provide also some additional extra functions for creating badges and logos,
see [Extras](https://ropengov.github.io/rogtemplate/reference/index.html) for
more info.