mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
{{/* prettier-ignore-start */ -}}
|
||||
{{- /*
|
||||
Returns syntax-highlighted code from the given text.
|
||||
|
||||
This is useful as a terse way to highlight inline code snippets. Calling the
|
||||
highlight shortcode for inline snippets is verbose.
|
||||
*/}}
|
||||
|
||||
@example This is {{< hl python >}}inline{{< /hl >}} code.
|
||||
*/ -}}
|
||||
{{/* prettier-ignore-end */ -}}
|
||||
{{- $code := .Inner | strings.TrimSpace }}
|
||||
{{- $lang := or (.Get 0) "go" }}
|
||||
{{- $lang := or (.Get 0) "go" }}
|
||||
{{- $opts := dict "hl_inline" true "noClasses" true }}
|
||||
{{- transform.Highlight $code $lang $opts }}
|
||||
|
Reference in New Issue
Block a user