From 3e0bd3ce6b4f505ea9d6f1793824418aa8bb827b Mon Sep 17 00:00:00 2001 From: vimux Date: Tue, 15 Jan 2019 10:56:39 -0500 Subject: [PATCH] Add "Hugo Syntax Highlighting" test article --- .../content/post/syntax-highlighting.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 exampleSite/content/post/syntax-highlighting.md diff --git a/exampleSite/content/post/syntax-highlighting.md b/exampleSite/content/post/syntax-highlighting.md new file mode 100644 index 0000000..60d0104 --- /dev/null +++ b/exampleSite/content/post/syntax-highlighting.md @@ -0,0 +1,50 @@ +--- +title: Hugo Syntax Highlighting +description: Syntax Highlighting example test article that shows how to creating and highlighting code blocks in Hugo-generated site +date: 2018-04-15 +categories: + - "Development" +tags: + - "Chroma" + - "Hugo" + - "Syntax Highlighting" + - "HTML" + - "Markdown" +--- + +You can have code snippets highlighted so that they are easier to read on your site using Chroma, Hugo's default syntax highlighter. It is built in Go lang and is really, really fast – and for the most important parts compatible with Pygments. Chroma takes source code and other structured text and converts it into syntax highlighted HTML, ANSI-coloured text, etc. + + +The example below shows a simple HTML code snippet highlighted with the Hugo [highlight](https://gohugo.io/content-management/shortcodes/#highlight) built-in shortcode: + +{{< highlight html >}} + + + + + Example HTML5 Document + + +

Test

+ + +{{< /highlight >}} + +The following code snippet was used to achieve that result: + +``` +{{}} + + + + + Example HTML5 Document + + +

Test

+ + +{{}} +``` + +For more information, see "[Hugo Syntax Highlighting](https://gohugo.io/content-management/syntax-highlighting)" from official Hugo docs.