mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 12:13:58 +00:00
fix: prevent errors if show_related hasn't been added to params.toml
Fix 9e562fc076
This commit is contained in:
1 parent
3830aed960
commit
a5f4b872c5
2 files changed
+5
-1
No files matched your search
@@ -1,4 +1,5 @@
|
||||
{{ if site.Params.edit_page }}{{/* Make `edit_page` optional in `params.toml` - prevent errors if it's removed. */}}
|
||||
{{/* This makes `edit_page` optional in `params.toml` and prevents errors if it's removed. */}}
|
||||
{{ if site.Params.edit_page }}
|
||||
{{ if site.Params.edit_page.repo_url | and (index site.Params.edit_page.editable .Type) | and (ne .Params.editable false) | or .Params.editable }}
|
||||
{{/* Get language subfolder for multilingual sites. */}}
|
||||
{{/* Limitations: the subfolder param, `<LANG>.contentDir`, is unexposed in the Hugo `site` API so we attempt to workaround this issue. */}}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{{/* This makes `show_related` optional in `params.toml` and prevents errors if it's removed. */}}
|
||||
{{ if site.Params.show_related }}
|
||||
{{ if (index site.Params.show_related .Type) | and (ne .Params.show_related false) | or .Params.show_related }}
|
||||
{{ $related := site.RegularPages.Related . | first 5 }}
|
||||
{{ with $related }}
|
||||
@@ -11,3 +13,4 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user