Update date.html

When following this [workflow](https://bookdown.org/yihui/blogdown/workflow.html), there is an error when serving the site :

```
Launching the server via the command:
  /Users/antoinesoetewey/Library/Application Support/Hugo/0.82.0/hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t congo -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:11:11: executing "main" at <partial "article-meta.html" (dict "context" . "scope" "single")>: error calling partial: execute of template failed: template: partials/article-meta.html:16:36: executing "partials/article-meta.html" at <partial "meta/date.html" .>: error calling partial: "/Users/antoinesoetewey/Documents/GitHub/elsaetantoine/themes/congo/layouts/partials/meta/date.html:2:24": execute of template failed: template: partials/meta/date.html:2:24: executing "partials/meta/date.html" at <.Site.Params.article.dateFormat>: invalid value; expected string
```

By adding these parentheses, the site is served without any error.

Regards,
Antoine
pull/66/head
Antoine Soetewey 2021-12-27 12:06:09 +01:00 committed by GitHub
parent 7f9b2cbc61
commit 5c9438e952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,10 +1,10 @@
<time datetime="{{ .Date }}">
{{- .Date.Format .Site.Params.article.dateFormat | default "2 January 2006" -}}
{{- .Date.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}}
</time>
{{ if .Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false) }}
&nbsp;(Updated:&nbsp;
<time datetime="{{ .Lastmod }}">
{{- .Lastmod.Format .Site.Params.article.dateFormat | default "2 January 2006" -}}
{{- .Lastmod.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}}
</time>
)
{{ end }}