create_theme: Create a Distill theme CSS file

View source: R/theme.R

create_themeR Documentation

Create a Distill theme CSS file

Description

Create a theme CSS file and write it to the current working directory

Usage

create_theme(name = "theme", edit = TRUE)

Arguments

name

Name of theme file (will be written as name.css)

edit

Open an editor for the theme file

Details

How do you apply a custom theme to a Distill site or blog? You have two options:

  1. Apply it site-wide by adding a theme key to the top-level of your ⁠_site.yml⁠ configuration file:

    name: "distill"
    title: "Distill for R Markdown"
    theme: theme.css
    navbar:
      # (navbar definition here)
    
  2. Apply to an individual article by adding a theme key to your article’s YAML front-matter:

    ---
    title: "The Sharpe Ratio"
    output:
      distill::distill_article:
        toc: true
        theme: theme.css
    ---
    

The second option allows for you to apply your theme to individual articles, while using a different theme for the rest of your site. Note that this is only possible for stand-alone articles within a website — you cannot apply a theme to individual blog posts only.

More details

For further details about theming refer to the online documentation.


distill documentation built on Oct. 6, 2023, 5:06 p.m.