mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-06 08:43:40 +00:00
Tweak theme
This commit is contained in:
16
themes/custom-theme/layouts/shortcodes/prism-features.html
Normal file
16
themes/custom-theme/layouts/shortcodes/prism-features.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{ $type := .Get 0 }}
|
||||
{{ $languages := readDir "node_modules/prismjs/components" }}
|
||||
{{ $plugins := readDir "node_modules/prismjs/plugins" }}
|
||||
|
||||
{{ if eq $type "languages" }}
|
||||
{{ range after 1 $languages -}}
|
||||
{{ $lang := .Name | replaceRE ".*\\.min\\.js" "" | replaceRE "prism-([\\w-]*).js" "${1}" -}}
|
||||
{{ if not (eq $lang "") }}
|
||||
{{ $lang -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
{{ else if eq $type "plugins" }}
|
||||
{{ range $plugins }}
|
||||
{{ path.Base .Name -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
Reference in New Issue
Block a user