mlr3website
- The root directory contains themlr3website
R package.mlr-org/
- Quarto project.mlr-org/gallery
- Gallery posts..github/workflows
Contains workflows to build the website and render gallery posts
The website is rendered in a virtual environment. The renv
package is
used to manage the virtual environment. This ensures that we all edit
the website with the same package versions.
- Clone the
mlr-org/mlr3website
repository. - Call
renv::restore(project = "mlr-org/")
to download and install all required packages. - Run the following command from your terminal to preview the website:
quarto preview mlr-org/
Freeze
The gallery posts are frozen i.e. the documents are not re-rendered
during a global project render. Calling quarto preview mlr-org/
or
quarto render mlr-org/
will not render the gallery posts again.
Calling quarto render
on a single file or subdirectory will re-render
the single file or all files in the subdirectory.
RSS
The rss feed of the gallery is published on R-bloggers.
CSS
The global css rules are stored in mlr-og/custom.scss
. When editing
the file, try to stick to the BEM naming pattern and use SASS. We use
the Bootswatch Yeti theme. A few style
options are specified in mlr-org/_quarto.yml
in the Theme
section.
The gallery is divided into four broad categories basic
,
optimization
, pipelines
and technical
. The posts are stored in the
corresponding subdirectories in mlr-org/gallery
. If you write a
series, add it to the series
directory.
- Create a subdirectory in
mlr-org/gallery/{category}
. - Start with a new
index.qmd
file and write your post. - Use only one sentence for the description and start with a verb. Do not repeat the title. See the previously published articles for examples.
- Render the post with
quarto render mlr-org/gallery/{category}/{post}/index.qmd
.
Because the gallery posts are not rendered in the CI, you need to ensure
that the rendered file is contained in the mlr-org/_freeze
subdirectory.
If your post needs a new package or package version:
- Install the package with
renv::install()
in the virtual environment. - Call
renv::snapshot()
to record the package inrenv.lock
. - Commit
renv.lock
with the new post.
Pages are .qmd
files located in the mlr-org/
directory
(e.g. packages.Rmd
). See quarto.org to learn
more about Quarto.
build-website.yml
Builds website. On main
, the website is pushed to gh-pages
branch.
On pull request, the website is previewed with Netlify. The gallery is
frozen. Note that this does not use the renv
file but instead uses
only the dependencies from the mlr3website
package. This e.g. ensures
that the overview lists are up to date.
gallery-weekly.yml
The workflow restores the renv virtual environment and updates all packages. Then all gallery posts are re-rerendered. Runs once a week.