Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

How to change the highlight code css theme to something other then default?

Started by gautam 8 years ago · 3 replies · 662 views
8 years ago

I have started using the hightlight code plugin ::- https://github.com/getgrav/grav-plugin-highlight.

All i have to do is install this plugin and now anything that i wrap in (``` ````) is highlighted.

I would like to make one change though , I.E. change the highlight theme to something else other then the default , if i check the highlight.php file , i see the following line of code:

$theme = $this->config->get('plugins.highlight.theme') ?: 'default';
$this->grav['assets']->addCss('plugin://highlight/css/'.$theme.'.css');

Where exactly is the plugins.highlight.theme file though , and how do change this option ?

8 years ago

hi @gautamz07

If i understand well, everything in the doc:

in your frontmatter

YAML
---
title: Sample Code With Custom Theme
highlight:
    theme: monokai
---

change theme to what suit you need
i think all themes here or here to see them in action

Hope it helps

👍 1
8 years ago

@dimitrilongo:

title: Sample Code With Custom Theme
highlight:
theme: monokai

Thanks @dimitrilongo , but what if i want to set a global theme for all my blog pages ?

8 years ago

Got it , i have to edit the highlight.yaml file. Thanks for the help !! 🙂

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 82 12 hours ago
General · by pamtbaau, 17 hours ago
1 55 16 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 348 5 days ago
General · by Duc , 5 days ago
3 43 5 days ago