
- Use resources.Get for safer file reading instead of readFile - Prevents directory traversal attacks - Ensures file access within Hugo's assets pipeline - Better error handling for missing files - Add fallback copyright notice when footer.md is not found - Add warning message for fallback to default footer
11 lines
387 B
HTML
11 lines
387 B
HTML
{{ if site.Params.theme_config.isShowFooter }}
|
|
{{ with resources.Get "layouts/footer.md" }}
|
|
{{ .Content | markdownify }}
|
|
{{ else }}
|
|
{{ warnf "layouts/footer.md file is not found, fallback to the default copyright" }}
|
|
<footer class="site-footer">
|
|
<p>© {{ now.Format "2006" }} {{ site.Title }}</p>
|
|
</footer>
|
|
{{ end }}
|
|
{{ end }}
|