diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-07-10 01:05:41 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-07-10 01:05:41 +0800 |
commit | d3a1ab071c983586b474c5e5dc0fa6afb0babce8 (patch) | |
tree | c7a0f76d76f30232ea347d225ddd916edb3bb353 /exampleSite/content/post/syntax-highlighting.md | |
parent | 77101032aa61cad251fbe02476aa6d1e0df24d74 (diff) |
docs(exampleSite): update for chroma
Diffstat (limited to 'exampleSite/content/post/syntax-highlighting.md')
-rw-r--r-- | exampleSite/content/post/syntax-highlighting.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/exampleSite/content/post/syntax-highlighting.md b/exampleSite/content/post/syntax-highlighting.md index b2f0770..9e5558d 100644 --- a/exampleSite/content/post/syntax-highlighting.md +++ b/exampleSite/content/post/syntax-highlighting.md @@ -98,3 +98,69 @@ object HelloWorld with Application { ```python print("Hello, World!") ``` + +```go-html-template +<!DOCTYPE html> +<html> +<head> + <title>{{ .Title }}</title> +</head> +<body> + <h1>{{ .Title }}</h1> + {{ .Content }} +</body> +</html> +``` + +```go-html-template +{{ partial "header.html" . }} + + <h1>posts</h1> + {{ range first 10 .Data.Pages }} + {{ if eq .Type "post"}} + <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2> + {{ end }} + {{ end }} + + <h1>pages</h1> + {{ range .Data.Pages }} + {{ if or (eq .Type "page") (eq .Type "about") }} + <h2><a href="{{ .Permalink }}">{{ .Type }} - {{ .Title }} - {{ .RelPermalink }}</a></h2> + {{ end }} + {{ end }} + +{{ partial "footer.html" . }} +``` + +--- + +Detect the language + +``` +package hello + +fun main(args: Array<String>) { + println("Hello World!") +} +``` + +``` +<?php + echo 'Hello, World!'; +?> +``` + +--- + +By `{{</* highlight go-html-template "linenos=table,hl_lines=1 3-7,linenostart=199" */>}}..{{</* / highlight */>}}` + +{{< highlight go-html-template "linenos=table,hl_lines=1 3-7,linenostart=199" >}} +<section id="main"> + <div> + <h1 id="title">{{ .Title }}</h1> + {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} + </div> +</section> +{{< / highlight >}} |