setup
This commit is contained in:
12
themes/hugo-theme-monochrome/layouts/partials/content.html
Normal file
12
themes/hugo-theme-monochrome/layouts/partials/content.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ $ctx := .ctx }}
|
||||
{{ $content := .content }}
|
||||
{{ $enable_line_no := ($ctx.Scratch.Get "params").syntax_highlight.prism.enable_line_no | default true }}
|
||||
|
||||
<article {{ if $enable_line_no }}class="line-numbers"{{ end }}>
|
||||
{{ $content := $content | replaceRE "<table>" "<table class=\"mc-table\">" }}
|
||||
{{ if eq ($ctx.Scratch.Get "params").syntax_highlight.lib "prism.js" }}
|
||||
{{ $content = $content | replaceRE "<pre>" "<pre class=\"language-text\">" }}
|
||||
{{ $content = $content | replaceRE "<pre([^>]*)class=\"([^>]*)\"([^>]*)>" "<pre$1 class=\"mc-prism hide $2\" $3>" }}
|
||||
{{ end }}
|
||||
{{ $content | safeHTML }}
|
||||
</article>
|
||||
Reference in New Issue
Block a user