{{$file := .Get "file"}}
{{- if eq (.Get "markdown") "true" -}}
{{- $file  | readFile | markdownify -}}
{{- else if  (.Get "highlight") -}}
{{-  highlight ($file  | readFile) (.Get "highlight") "" -}}
{{- else -}}
{{ $file  | readFile | safeHTML }}
{{- end -}}

Add a shortcode to allow "shared file include"
Add a shortcode to allow "shared file include"

Copied from https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes

Usage: To copy content from a 'shared' file, into another file (to reduce unnecessary content duplication), add:

{{% readfile file="/path/to-file/from-site-root/readfile-example.md" %}}