mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 14:14:48 +00:00
partials: Fix case where .Permalink may be called on nil
See #534 and #532
This commit is contained in:
1 parent
6988b4074b
commit
9842f517dd
2 files changed
+14
-6
No files matched your search
@@ -31,9 +31,13 @@
|
||||
{{ end }}
|
||||
{{ if $.Params.projects }}
|
||||
{{ range $.Params.projects }}
|
||||
<a class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}}" href="{{ ($.Site.GetPage "page" "project" .).Permalink }}">
|
||||
{{ i18n "btn_project" }}
|
||||
</a>
|
||||
{{ with ($.Site.GetPage "page" "project" .) }}
|
||||
<a class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}}" href="{{ .Permalink }}">
|
||||
{{ i18n "btn_project" }}
|
||||
</a>
|
||||
{{ else }}
|
||||
{{ errorf "Please check that the `projects` parameter in the front matter of content in `content/publication/` refers to an existing filename (without .md extension) of a published project." }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with $.Params.url_project }}
|
||||
|
||||
@@ -22,9 +22,13 @@
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ range $.Params.projects }}
|
||||
<a class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}}" href="{{ ($.Site.GetPage "page" "project" .).Permalink }}">
|
||||
{{ i18n "btn_project" }}
|
||||
</a>
|
||||
{{ with ($.Site.GetPage "page" "project" .) }}
|
||||
<a class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}}" href="{{ .Permalink }}">
|
||||
{{ i18n "btn_project" }}
|
||||
</a>
|
||||
{{ else }}
|
||||
{{ errorf "Please check that the `projects` parameter in the front matter of content in `content/talk/` refers to an existing filename (without .md extension) of a published project." }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range $.Params.url_custom }}
|
||||
<a class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}}" href="{{ .url | absURL }}">
|
||||
|
||||
Reference in new issue
Block a user