pkgdown 2.0.0 - Tidyverse (original) (raw)

We’re very chuffed to announce the release of pkgdown 2.0.0. pkgdown is designed to make it quick and easy to build a website for your package. Install it with:

This is a massive release that brings a major visual refresh and a huge number of improvements. This release would not have been possible without pkgdown’s newest author, Maëlle Salmon, who was the powerhouse behind many of the improvements in this release, particularly the switch to Bootstrap 5, improved customisation, and implementation of local search.

There are way too many changes to describe individually here, so this post will focus on the most important new features:

See the release notes for a complete list of everything that’s changed.

Bootstrap 5

pkgdown comes with a refreshed template that uses Bootstrap 5, a major update over the previous Bootstrap 3. (Bootstrap is the collection of HTML, CSS, and JS files that give pkgdown sites their basic style). Because this is a major change, you’ll need to opt-in by setting the boostrap version in your _pkgdown.yml:

The old Bootstrap 3 template is superseded; it will continue to work for some time, but it won’t gain any new features and we encourage you to switch to the new template the next time you’re working on your package.

The new theme includes:

As an added incentive to upgrade your template to Bootstrap 5, you’ll get site search for “free”: pkgdown now supports searching with no external dependencies and no setup. Learn more in vignette("search").

Customisation

The new template is also much easier to customise. A few of the most important features are noted below to whet your appetite; learn more in vignette("customise").

template:  
  bootstrap: 5  
  bootswatch: cyborg  

Or by selectively overriding the “bslib” variables used to generate the CSS:

template:  
  bootstrap: 5  
  bslib:  
    bg: "#202123"  
    fg: "#B8BCC2"  
    primary: "#306cc9"  
    base_font: {google: "Roboto"}  

You can also choose a different syntax highlighting theme:

template:  
  bootstrap: 5  
  theme: arrow-dark  

If any of these options sound intriguing, read vignette("customise") to get the full details!

templates:  
  includes:  
    in_header: |  
      <script defer data-domain="{YOUR DOMAIN}" src="https://plausible.io/js/plausible.js"></script>  

Learn more in ?build_site.

Code display

We made a bunch of smaller tweaks to the display of code:

Other new features

redirects:  
  - ["articles/old-vignette-name.html", "articles/new-vignette-name.html"]  
  - ["articles/another-old-vignette-name.html", "articles/new-vignette-name.html"]  
  - ["articles/yet-another-old-vignette-name.html", "https://pkgdown.r-lib.org/dev"]  

(Old path on the left, new path on the right)

::: {.pkgdown-devel}  
You can install the development version of pkgdown from GitHub with:  
`remotes::install_github("r-lib/pkgdown")`  
:::  

Acknowledgements

@1beb, @a-beretta, @aaamini, @adamsma, @AdrianAntico, @alanaw1, @aleruete, @amirmasoudabdol, @Anirban166, @apreshill, @arisp99, @atusy, @ayushnoori, @b4D8, @bastistician, @bbolker, @Bisaloo, @c4f3a0ce, @cbailiss, @cboettig, @cderv, @chrarnold, @colearendt, @cpsievert, @crazycapivara, @davidchall, @DavidPatShuiFong, @dcnorris, @dcousin3, @debruine, @dfriend21, @dieghernan, @djnavarro, @dmurdoch, @drwilkins, @earowang, @EmilHvitfeldt, @exploringfinance, @fangzhou-xie, @fenguoerbian, @francojc, @gaborcsardi, @gadenbuie, @GeoBosh, @GitHunter0, @gustavdelius, @hadley, @HenrikBengtsson, @hfrick, @ijlyttle, @IndrajeetPatil, @JakeVestal, @jakob-wirbel, @JamesHWade, @jayhesselberth, @JedGrabman, @jennybc, @jessekps, @jhelvy, @jimhester, @john-harrold, @jonkeane, @jplecavalier, @jrosen48, @jscott6, @kevinushey, @kjhealy, @klmr, @krassowski, @krlmlr, @kuriwaki, @kyleam, @laresbernardo, @lbusett, @lionel-, @maelle, @ManuelHentschel, @MarkEdmondson1234, @matthewstrasiotto, @mattwarkentin, @maxheld83, @mcanouil, @mfherman, @mikeroswell, @mine-cetinkaya-rundel, @mjsteinbaugh, @moutikabdessabour, @mrcaseb, @msberends, @mtkerbeR, @nandp1, @npranav10, @p-carter, @pachadotdev, @paulponcet, @peterblattmann, @renejuan, @rich-iannone, @Rmomal, @Robinlovelace, @royfrancis, @rundel, @salim-b, @samuel-marsh, @samuel-rosa, @sarahemlin, @SchmidtPaul, @statnmap, @stefanoborini, @strengejacke, @topepo, @vandenman, @wlandau, @wolski, @wviechtb, @ycphs, and @yitao-li.