Skip to content

Commit 0ae508c

Browse files
committed
Updated setup vignette
1 parent daffba5 commit 0ae508c

2 files changed

Lines changed: 63 additions & 3 deletions

File tree

_pkgdown.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
url: https://mc-stan.org/pkgdown-config
2+
23
template:
34
package: pkgdownconfig
5+
46
development:
57
mode: auto

vignettes/Setup.qmd

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ knitr:
1010
comment: '#>'
1111
---
1212

13+
## General Setup
14+
1315
If you haven't started a `pkgdown` site yet, initialize it.
1416

1517
```r
@@ -23,6 +25,15 @@ template:
2325
package: pkgdownconfig
2426
```
2527
28+
Optional but highly recommended is to set development mode to auto and to build the site in root, like so:
29+
30+
```yaml
31+
destination: "."
32+
33+
development:
34+
mode: auto
35+
```
36+
2637
Point to this repository in `DESCRIPTION` to download the theme automatically.
2738

2839
```yaml
@@ -83,12 +94,59 @@ navbar:
8394
- text: shinystan
8495
href: https://mc-stan.org/shinystan
8596
```
97+
## Example (`shinystan`)
98+
99+
Put together, here's what a reasonable YAML looks like (truncated, taken from `shinystan`):
100+
101+
```yaml
102+
url: https://mc-stan.org/shinystan
103+
104+
destination: "."
105+
106+
development:
107+
mode: auto
108+
109+
template:
110+
package: pkgdownconfig
111+
112+
navbar:
113+
title: "shinystan"
114+
115+
structure:
116+
left: [home, vignettes, functions, news, pkgs, stan]
117+
right: [search, bluesky, forum, github, lightswitch]
118+
119+
components:
120+
pkgs:
121+
text: Other Packages
122+
menu:
123+
- text: bayesplot
124+
href: https://mc-stan.org/bayesplot
125+
- text: cmdstanr
126+
href: https://mc-stan.org/cmdstanr
127+
- text: "loo"
128+
href: https://mc-stan.org/loo
129+
- text: posterior
130+
href: https://mc-stan.org/posterior
131+
- text: projpred
132+
href: https://mc-stan.org/projpred
133+
- text: rstan
134+
href: https://mc-stan.org/rstan
135+
- text: rstanarm
136+
href: https://mc-stan.org/rstanarm
137+
- text: rstantools
138+
href: https://mc-stan.org/rstantools
139+
140+
# now you can add articles, references, etc.
141+
```
142+
143+
## Common Issues
86144

87-
If for some reason the favicons don't get copied over, download [logo.svg](https://github.com/stan-dev/logos/blob/master/logo.svg), and run `pkgdown::build_favicons()` once to build the favicons. If you already have favicons, the template my overwrite them to save a copy and ping `@Visruth` on the Stan Slack.
145+
If for some reason the favicons don't get copied over, check if you are defining favicons in `pkgdown/favicons`. In most cases you can delete everything in that folder--just delete the logo and favicons if you are worried. The template will hook in the correct favicon and logo. If its not working, download [logo.svg](https://github.com/stan-dev/logos/blob/master/logo.svg) to `/man/figures/logo.svg` and run `pkgdown::build_favicons()` once to build the favicons.
88146

89-
Note that the favicons and logo should be copied into your build directory and ideally should be hooked in automatically. If you can't find the logo, you can download it from [here](https://github.com/stan-dev/logos/blob/master/hex_stickers/stan_hex_cut.svg) and follow the same steps above.
147+
<!-- Note that logo should also be copied into your build directory and will be hooked in automatically. If you can't find the logo, you can download it from [here](https://github.com/stan-dev/logos/blob/master/hex_stickers/stan_hex_cut.svg) and follow the same steps above. -->
90148

91-
If you want the hex in your README, edit the `README.MD`. You can take a look at this package's to get an idea of what you need to do (repeated below):
149+
If you want the hex in your README (or if it isn't working), make sure to edit the `README.MD` or however you generate it. You can take a look at this package's to get an idea of what you need to do (repeated below):
92150

93151
```md
94152
# pkgdownConfig <a href="https://mc-stan.org/pkgdown-config"><img src="man/figures/logo.svg" align="right" height="139" alt="pkgdownConfig website" /></a>

0 commit comments

Comments
 (0)