younsl a0684e5add feat(footer): Add fallback footer and improve file reading
- 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
2024-11-18 01:26:06 +09:00

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>&copy; {{ now.Format "2006" }} {{ site.Title }}</p>
</footer>
{{ end }}
{{ end }}