mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-23 10:00:52 +02: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:
parent
6b70757505
commit
2b11b7e9fb
4 changed files with 6 additions and 5 deletions
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue