{{- /* Inserts a text file into the HTML. See https://preliminary.istio.io/about/contribute/writing-a-new-topic/#embedding-preformatted-blocks for details */ -}} {{- $name := split (.Get "file") "/" | last 1 -}} {{- $downloadas := index $name 0 -}} {{- if .Get "downloadas" -}} {{- $downloadas = .Get "downloadas" -}} {{- end -}} {{- $file := readFile (.Get "file") -}} {{- if (.Get "snippet") -}} {{- $pattern := printf "(?msU)(.*\\$snippet %s.*$\\n)(.*)(?-s)(\\n^.*\\$endsnippet.*$)(?s-U)(.*)" (.Get "snippet") -}} {{- $match := replaceRE $pattern "$2" $file -}}
{{- $match -}}
{{- else -}}
{{- $file -}}
{{- end -}}