-
Notifications
You must be signed in to change notification settings - Fork 0
Blogdown workflow
You need to have installed the following packages:
- blogdown
- bookdown
- tidyverse
- servr
You can override the project blogdown options
in <project root>.Rprofile
by defining them in your ~/Rprofile
, see D1 section in the blogdown
book.
The project is setup to have the generated HTML file put in ../pru-portal-generated
, so in the folder pru-portal-generated
one level up compared to the project folder. This makes your RStudio IDE much more responsive when the project is under version control and contains many many files (see D1 section in the blogdown
book.)
-
Download the hugo version you want to use (see also
netlify.toml
to test and define the hugo version for the different Deploy Contexts) -
On MS Windows work laptop copy the
hugo.exe
in the<home>/dev/
-
set the
blogdown.hugo.dir
option accordingly, see Appendix D 1 of the Blogdown book.
Clone the repo (AND submodules) to pru-portal
# clone the pru portal repo AND submodules
$ cd repos
$ git clone --recurse-submodules https://github.com/euctrl-pru/portal/ pru-portal
# create the directory where the generated HTML will be written
$ mkdir pru-portal-generated
IF you FORGOT to include the theme submodule:
$ cd repos/pru-portal
$ git submodule update --init
If you have hugo
installed separately that via blogdown
default location, you can specify where to find it via options
(better to set it in .Rprofile
, see Blogdown boo):
options(blogdown.hugo.dir = '/Users/espin/go/bin/')
-
In a
Git for Windows
terminal, go to the PRU website directory$ cd /c/repos/pru-portal
-
Move to the directory where HTML files will be generated
$ cd ../pru-portal-generated
-
Run a webserver
$ Rscript -e 'servr::httd()'
Within RStudio create or edit Rmd/md files and once ready build the site (only modified files will be regenerated):
> blogdown::build_site(local = TRUE)