hugo-theme-relearn/exampleSite/content/cont/syntaxhighlight.en.md
2021-08-24 00:47:18 +01:00

1.3 KiB

date title weight
2020-06-01T13:31:12+01:00 Code highlighting 16

Relearn theme uses Hugo's built-in syntax highlighting for code.

Markdown syntax

Wrap the code block with three backticks and the name of the language. Highlight will try to auto detect the language if one is not provided.

```json
[
  {
    "title": "apples",
    "count": [12000, 20000],
    "description": {"text": "...", "sensitive": false}
  },
  {
    "title": "oranges",
    "count": [17500, null],
    "description": {"text": "...", "sensitive": false}
  }
]
```

Renders to:

[
  {
    "title": "apples",
    "count": [12000, 20000],
    "description": {"text": "...", "sensitive": false}
  },
  {
    "title": "oranges",
    "count": [17500, null],
    "description": {"text": "...", "sensitive": false}
  }
]

Supported languages

Hugo comes with a remarkable list of supported languages.

Configuration

You can choose a color theme from the list of supported themes and add it in your config.toml

[markup]
  [markup.highlight]
    style = "monokai"