partials: Fix case where .Permalink may be called on nil

See #534 and #532
This commit is contained in:
George Cushen committed 2018-05-08 22:31:41 +01:00
1 parent 6988b4074b
commit 9842f517dd
2 files changed
+14 -6

No files matched your search

+7 -3
View File
@@ -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 }}
+7 -3
View File
@@ -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 }}">