Code highlight

Presentation template

Configuration files

Code highlight presentation template reads configuration variables from configuration files described below:

  1. Site’s configuration file:

    _config.yml
    

    Set default values for both site and page-specific configuration variables.

  2. Page preamble section of markdown files:

    **/*.md
    

    Set custom values for page-specific configuration variables. Page configuration variables defined in page preamble section of markdown files override page configuration variables defined in site’s configuration file.

Configuration variables

Name Description
with_highlight When it is not false, code highlight includes the highlight.js library to highlight blocks of code using the value passed as theme name. By default, stackoverflow-light theme is used.

Customizing code highlight at page level

To customize code highlight in a page, set with_hightlight to one of the supported hightlight.js themes in the preamble section.

---
title: This is a page with code highlight

with_hightlight: "stackoverflow-light"
---

Page content.

Customizing code highlight at site level

To customize code highlight in all site pages, set with_hightlight to one of the supported hightlight.js themes in the site configuration file.

---
defaults:
 - scope:
     path: "" # an empty string here means all files in the project.
   values:
     with_hightlight: "stackoverflow-light"