Skip to content

Commit

Permalink
Update pkgdown site to last template (#675)
Browse files Browse the repository at this point in the history
and update to v2 of r-lib/actions
  • Loading branch information
cderv committed Dec 20, 2021
1 parent 34fd546 commit d7f0f89
Show file tree
Hide file tree
Showing 33 changed files with 180 additions and 152 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^_pkgdown\.yml$
^pkgdown$
^vignettes$
^reference$
25 changes: 6 additions & 19 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
id: install-r
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true


- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- name: Install Hugo using blogdown
run: |
Expand All @@ -65,20 +65,7 @@ jobs:
blogdown::hugo_version()
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- uses: r-lib/actions/check-r-package@v2

- name: Test coverage
if: success() && runner.os == 'Linux' && matrix.config.r == 'release'
Expand Down
45 changes: 7 additions & 38 deletions .github/workflows/bookdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,60 +20,29 @@ jobs:
uses: actions/checkout@v2

- name: Setup R
uses: r-lib/actions/setup-r@v1
uses: r-lib/actions/setup-r@v2

- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v1
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.11.4'

- name: Install TinyTeX
uses: r-lib/actions/setup-tinytex@v1
uses: r-lib/actions/setup-tinytex@v2
env:
# install full prebuilt version
TINYTEX_INSTALLER: TinyTeX

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}-${{ hashFiles('docs/index.Rmd') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}-
${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install OS dependencies
run: |
brew update --preinstall
brew install --cask xquartz
brew install --cask calibre
# required for pkgdown install
brew install harfbuzz fribidi
- name: Install R dependencies for blogdown
run: |
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

- name: Install blogdown package
run: xfun::install_dir(".")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
remotes::install_cran("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
rmarkdown::find_pandoc()
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::.
needs: book

- name: Cache bookdown results
uses: actions/cache@v2
Expand Down
57 changes: 18 additions & 39 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,48 @@
on:
push:
branches:
- main
- master
branches: [main, master]
tags: ['*']
pull_request:
branches:
- main
- master

branches: [main, master]
name: pkgdown

jobs:
pkgdown:
if: ${{ github.event_name == 'push' || startsWith(github.head_ref, 'pkgdown/') }}
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
id: install-r

- uses: r-lib/actions/setup-pandoc@v1

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps(".", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
use-public-rspm: true

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("pkgdown", execute = TRUE)
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package and dependencies
# TODO : remove when https://github.com/r-lib/pak/issues/347 is fixed
- name: install webshot2
env:
PKG_SYSREQS: false
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("r-lib/pkgdown")
pak::pkg_install("rstudio/quillt")
pak::pkg_install("rstudio/webshot2") # for screenshot
pak::pak("rstudio/webshot2")
shell: Rscript {0}

- name: Install optipng
# required to optimize images
run: brew install optipng

- name: Install package
run: R CMD INSTALL .

- name: Cache some pkgdown assets
uses: actions/cache@v2
with:
path: 'vignettes/articles/images/*.png'
path: |
vignettes/articles/images/*.png
key: 1-${{ hashFiles('vignettes/articles/examples.yml') }}

- name: Build pkgdown site
Expand Down
45 changes: 24 additions & 21 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: blogdown
Type: Package
Package: blogdown
Title: Create Blogs and Websites with R Markdown
Version: 1.7.1
Authors@R: c(
Expand Down Expand Up @@ -35,32 +35,35 @@ Authors@R: c(
person(family = "RStudio, PBC", role = "cph"),
person()
)
Description: Write blog posts and web pages in R Markdown. This package supports
the static site generator 'Hugo' (<https://gohugo.io>) best, and it also
supports 'Jekyll' (<https://jekyllrb.com>) and 'Hexo' (<https://hexo.io>).
Description: Write blog posts and web pages in R Markdown. This package
supports the static site generator 'Hugo' (<https://gohugo.io>) best,
and it also supports 'Jekyll' (<https://jekyllrb.com>) and 'Hexo'
(<https://hexo.io>).
License: GPL-3
URL: https://github.com/rstudio/blogdown,
https://pkgs.rstudio.com/blogdown
BugReports: https://github.com/rstudio/blogdown/issues
Imports:
rmarkdown (>= 2.8),
bookdown (>= 0.22),
knitr (>= 1.25),
htmltools,
yaml (>= 2.1.19),
httpuv (>= 1.4.0),
jsonlite,
knitr (>= 1.25),
later,
rmarkdown (>= 2.8),
servr (>= 0.21),
xfun (>= 0.29),
jsonlite,
servr (>= 0.21)
yaml (>= 2.1.19)
Suggests:
testit,
shiny,
miniUI,
stringr,
rstudioapi,
tools,
processx,
whoami
URL: https://github.com/rstudio/blogdown, https://pkgs.rstudio.com/blogdown
BugReports: https://github.com/rstudio/blogdown/issues
SystemRequirements: Hugo (<https://gohugo.io>) and Pandoc (<https://pandoc.org>)
RoxygenNote: 7.1.2
miniUI,
processx,
rstudioapi,
shiny,
stringr,
testit,
tools,
whoami
Config/Needs/website: pkgdown, tidyverse/tidytemplate, rstudio/quillt
Encoding: UTF-8
RoxygenNote: 7.1.2
SystemRequirements: Hugo (<https://gohugo.io>) and Pandoc (<https://pandoc.org>)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# blogdown <a href="https://pkgs.rstudio.com/blogdown"><img src="https://bookdown.org/yihui/blogdown/images/logo.png" align="right" height="139" /></a>
# blogdown

<!-- badges: start -->
[![R-CMD-check](https://github.com/rstudio/blogdown/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/blogdown/actions)
Expand Down
80 changes: 49 additions & 31 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ destination: reference
url: https://pkgs.rstudio.com/blogdown/

template:
package: quillt
package: tidytemplate
bootstrap: 5
bslib:
primary: "#096B72"
navbar-background: "#e6f3fc"
trailingslash_redirect: true
opengraph:
image:
src: https://bookdown.org/yihui/blogdown/images/logo.png
Expand All @@ -13,43 +18,56 @@ template:
card: summary

development:
version_tooltip: "Development version"
mode: devel
destination: "."

home:
links:
- text: Learn more about R Markdown
href: "https://rmarkdown.rstudio.com"

# custom footer for rmarkdown ecosystem
footer:
structure:
left: [rmd]
right: [developed_by, p, built_with]
components:
p: "\n\n"
rmd: |
**blogdown** is a part of the **R Markdown** ecosystem of packages for creating
computational documents in R.<br>Learn more at
[rmarkdown.rstudio.com](https://rmarkdown.rstudio.com/).
# structure of website themed for R Markdown ecosystem
navbar:
title: ~
type: default
structure:
left: [intro, examples, articles]
right: [reference, news, github]
left: [intro, examples, articles, reference, news]
components:
home: ~
examples:
text: Examples
href: articles/articles/examples.html
articles:
text: Articles
menu:
- text: "No vignettes"
reference:
text: Reference
href: reference/index.html
github:
icon: fab fa-github fa-lg
href: https://github.com/rstudio/blogdown
news:
text: News
menu:
- text: "Changelog"
href: news/index.html
- text: "------------------"
- text: "Blog posts"
- text: "Version 1.6"
href: https://yihui.org/en/2021/11/blogdown-v1-6/
- text: "Version 1.0"
href: https://blog.rstudio.com/2021/01/18/blogdown-v1.0/
- text: "Version 0.1"
href: https://blog.rstudio.com/2017/09/11/announcing-blogdown/
href: articles/examples.html

# Add articles menu using
# https://pkgdown.r-lib.org/dev/reference/build_articles.html#index-and-navbar
articles:
- title: Get Started
desc: |
Start here to know how to learn **blogdown**
contents:
- blogdown
- title: Example
desc: Gallery of examples
contents:
- articles/examples

news:
releases:
- text: "Version 1.6"
href: https://yihui.org/en/2021/11/blogdown-v1-6/
- text: "Version 1.0"
href: https://blog.rstudio.com/2021/01/18/blogdown-v1.0/
- text: "Version 0.1"
href: https://blog.rstudio.com/2017/09/11/announcing-blogdown/

reference:
- title: Output formats
Expand Down
Loading

0 comments on commit d7f0f89

Please sign in to comment.