I try to create components from bootstrap for AMP compatible HUGO theme. Unfortunately when I try to print the result:
"
is replaced by
"
Here is my code - an the replacement is happening in the last step:
{{/* 1. Get Resource */}}
{{ $bootstrapAMP := resources.Get "scss/bootstrap/bootstrap-amp.scss" }}
{{/* 2. PostCSS => css folder */}}
{{ $bootstrapAMPSource := $bootstrapAMP | resources.ToCSS (dict "targetPath" "css/bootstrap.css") | resources.PostCSS (dict "config" "postcss.config.js") | resources.Minify }}
{{/* 3.from css folder => replace uncompatible part */}}
{{ $bootstrapCSSAMP := replace (replace $bootstrapAMPSource.Content "!important" "") "@-ms-viewport{width:device-width;}" "" }}
{{/* 4. define where to place the style component */}}
{{ $bootstrapTargetPath := "css/bootstrap-amp.css" }}
{{/* 5. string => resource "-amp" => place the file in css folder */}}
{{ $bootstrapCSSAMPFile := $bootstrapCSSAMP | resources.FromString $bootstrapTargetPath }}
{{/* 6. render the css file for production */}}
<!-- {{ $bootstrapCSSAMPFile.Permalink }} -->
{{/* 7. print the output vor development */}}
{{ $bootstrapCSSAMP | print | safeCSS }}