18 lines
553 B
HTML
18 lines
553 B
HTML
{{/*
|
|
Partial: include.html
|
|
Handles including external Markdown files and rendering them.
|
|
Parameters:
|
|
- context: The Page context (required for RenderString)
|
|
- path: Path to the file, relative to the project root
|
|
*/}}
|
|
{{- $path := .path -}}
|
|
{{- $context := .context -}}
|
|
|
|
{{- if fileExists $path -}}
|
|
{{- $content := readFile $path -}}
|
|
{{- $context.RenderString $content -}}
|
|
{{- else -}}
|
|
{{- warnf "Include file not found: %s" $path -}}
|
|
<p class="text-red-500 font-bold">[Include Error: File "{{ $path }}" not found]</p>
|
|
{{- end -}}
|