2023-07-27 14:14:55 +00:00
|
|
|
{{- $page := .page }}
|
|
|
|
{{- if and (not $page) .context }}
|
|
|
|
{{- $page = .context }}
|
2023-07-27 15:47:36 +00:00
|
|
|
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'include' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
|
2023-07-27 14:14:55 +00:00
|
|
|
{{- end }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- $file := .file }}
|
2022-06-23 11:22:04 +00:00
|
|
|
{{- $hideFirstHeading := .hidefirstheading | default false }}
|
|
|
|
{{- if eq (printf "%T" $hideFirstHeading) "string" }}
|
|
|
|
{{- $hideFirstHeading = (eq $hideFirstHeading "true") }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- end }}
|
2023-02-19 22:09:51 +00:00
|
|
|
{{- if and (gt (len (trim $file " ")) 0) (fileExists $file) }}
|
|
|
|
{{- if $hideFirstHeading }}<div class="include hide-first-heading">{{ end }}
|
2023-07-27 14:14:55 +00:00
|
|
|
{{- with $page }}
|
2022-06-22 18:32:18 +00:00
|
|
|
|
|
|
|
{{ $file | readFile | safeHTML }}
|
|
|
|
|
2023-02-19 22:09:51 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if $hideFirstHeading }}</div>{{ end }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- end }}
|