2023-07-27 14:14:55 +00:00
|
|
|
{{- $page := .page }}
|
|
|
|
{{- if and (not $page) .context }}
|
|
|
|
{{- $page = .context }}
|
2023-11-20 23:53:33 +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.Filename }}
|
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) }}
|
2023-11-16 21:50:35 +00:00
|
|
|
{{- if $hideFirstHeading }}<div class="include hide-first-heading">
|
2022-06-22 18:32:18 +00:00
|
|
|
|
2023-11-16 21:50:35 +00:00
|
|
|
{{ end }}
|
|
|
|
{{- with $page }}
|
|
|
|
{{- $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 }}
|