---
title: 'Highlight.js add-on (Statamic v1)'
url: 'https://maxwesten.nl/projects/statamic-addons/highlight-plugin'
markdown: 'https://maxwesten.nl/projects/statamic-addons/highlight-plugin.md'
date: '2012-07-08'
description: 'UPDATE: This add-on is for Statamic V1 -- Deprecated! This is the addon for Statamic V1. The development and support has stopped. The version for Statamic V2 can be found here. Introduction This add-on adds Highlight.js v 9.0 code highlighting to your pages. All codeblocks are color-coded/highlighted according to the selected theme. Installation Clone or Copy the files to their destination Clone this project on your system: cd webfolder/_add-ons git://github.com/mwesten/Plugin-Highlight.git highlight Or download the project and add the contents of archive to the _add-ons/highl'
taxonomy:
  archives_month:
    - jul_2012
  archives_year:
    - '2012'
---

# Highlight.js add-on (Statamic v1)

[Home](https://maxwesten.nl/)  [Projects](https://maxwesten.nl/projects)  [Statamic Addons](https://maxwesten.nl/projects/statamic-addons)  Highlight.js (S1) 

## [Highlight.js add-on (Statamic v1)](https://maxwesten.nl/projects/statamic-addons/highlight-plugin)[on GitHub](https://github.com/mwesten/Plugin-Highlight)

    8th Jul 2012  

## UPDATE: This add-on is for Statamic V1 -- Deprecated!

This is the addon for Statamic V1. The development and support has stopped. [The version for Statamic V2 can be found here.](https://maxwesten.nl/projects/statamic-addons/highlight-v2-addon)

## Introduction

This add-on adds [Highlight.js](https://highlightjs.org/) v 9.0 code highlighting to your pages.
All codeblocks are color-coded/highlighted according to the selected theme.

## Installation

### Clone or Copy the files to their destination

Clone this project on your system:

```
cd webfolder/_add-ons
git://github.com/mwesten/Plugin-Highlight.git highlight
```

Or download the project and add the contents of archive to the `_add-ons/highlight` folder.

### Add the highlight init code to your head

Open the theme file layout (for example) `_themes/london-wild/layouts/default.html`
Add the following code in your `<head>` section:{{noparse}}

```
{{ highlight:head }}
```

{{/noparse}} This displays the highlight.js in the default theme.
You can also select one of the added themes that you can find in the `_add-ons/highlight/highlight/styles` folder; for example the Sunburst theme:{{noparse}}

```
{{ highlight:head style="sunburst"}}
```

{{/noparse}} If you like you can add the code just before your body close tag instead of in your `<head>`. This is a matter of preference.

## Usage

When codeblocks are used (1 tab or 4 spaces) Highlight.js tries to guess what code is used. (You can inspect the class on the generated `<pre> … </pre>` codeblock to see how it was interpreted.)
If the autodetection didn't work out correctly or you just want control over the rendering, just wrap the code in a manual codeblock and add the language to the code class.
See for more information the [Highlight.js documentation](http://highlightjs.readthedocs.org/en/latest/).

[←](https://xn--sr8hvo.ws/%F0%9F%92%95%F0%9F%8E%89%E2%A4%B5%EF%B8%8F/previous)An IndieWeb Webring 🕸💍 [→](https://xn--sr8hvo.ws/%F0%9F%92%95%F0%9F%8E%89%E2%A4%B5%EF%B8%8F/next)

---

## Navigation

- Parent: [Statamic Addons](https://maxwesten.nl/projects/statamic-addons.md)
- Previous: [Flickr Random badges add-on (Statamic v1)](https://maxwesten.nl/projects/statamic-addons/flickr-plugin.md)
- Next: [FancyBox2 add-on (Statamic v1)](https://maxwesten.nl/projects/statamic-addons/fancybox-plugin.md)
