mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-11 12:11:45 +00:00
feat(tailwind): prevent error when using hugo new site
As unfortunately Hugo always triggers error even when using `with` statement with a non-safelisted `os.Getenv` var
This commit is contained in:
1 parent
6b70757505
commit
2b11b7e9fb
4 files changed
+6
-5
No files matched your search
@@ -80,9 +80,10 @@ module:
|
||||
security:
|
||||
funcs:
|
||||
getenv:
|
||||
# Allow HUGO_ and HUGO_BLOX_ vars
|
||||
- ^HUGO_
|
||||
- ^WC_
|
||||
- ^HB_
|
||||
# Allow continuous integration vars
|
||||
- ^CI$
|
||||
outputFormats:
|
||||
backlinks:
|
||||
mediaType: application/json
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{{ if eq .Type "landing" }}
|
||||
{{ range $index, $block := .Params.sections }}
|
||||
{{/* Do not show sections intended only for the demo site. */}}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "WC_DEMO") "true")) }}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "HUGO_BLOX_DEMO") "true")) }}
|
||||
{{ $block_type := lower ($block.blox | default $block.block) | default "markdown" }}
|
||||
{{ range $r := site.Data.blox_aliases.renames }}
|
||||
{{ $block_type = cond (eq $block_type $r.old) $r.new $block_type }}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{/* Load Hugo Blox */}}
|
||||
{{ range $index, $block := .Params.sections }}
|
||||
{{/* Do not show sections intended only for the demo site. */}}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "WC_DEMO") "true")) }}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "HUGO_BLOX_DEMO") "true")) }}
|
||||
{{ partial "functions/parse_block_v2" (dict "page" $ "block" $block) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -56,7 +56,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Style */}}
|
||||
{{ if ne (os.Getenv "WC_POSTCSS") "true" }}
|
||||
{{ if ne (os.Getenv "HUGO_BLOX_POSTCSS") "true" }}
|
||||
{{ $styles := resources.Get "dist/wc.min.css" }}
|
||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||
{{ else }}
|
||||
|
||||
Reference in new issue
Block a user