Skip to content

Commit

Permalink
Fix bug in author params code, reported in issue #117.
Browse files Browse the repository at this point in the history
  • Loading branch information
frjo committed Nov 6, 2024
1 parent 9650ade commit a1e9b05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/author-date.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{ with $.Param "author" | default site.Params.author.name }}<span class="author" itemprop="author">{{ . }}</span>{{ end -}}
{{ if and .Date (or ($.Param "author") site.Params.author.name) }} - {{ end -}}
{{ with .Params.author | default site.Params.author.name }}<span class="author" itemprop="author">{{ . }}</span>{{ end -}}
{{ if and .Date (or .Params.author site.Params.author.name) }} - {{ end -}}
{{ with .Date }}<time class="created-date" datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ .Format ($.Param "dateformat" | default "2 January, 2006") }}</time>{{ end }}
2 changes: 1 addition & 1 deletion layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="description" content="{{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) }}{{ . }}{{ end }}">
<meta name="created" {{ printf "content=%q" (.Date.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
<meta name="modified" {{ printf "content=%q" (.Lastmod.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
{{ with .Params.author | default site.Params.author.name }}<meta name="author" content="{{ . }}">{{ end }}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
<meta property="og:site_name" content="{{ site.Title }}">
<meta property="og:title" content="{{ .Title }}">
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/meta_json_ld.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{{ with $.Param "image" -}}
"image" : {{ . | absURL }},
{{ end -}}
{{ with $.Param "author" -}}
{{ with .Params.author | default site.Params.author.name -}}
"author": {
"@type": "Person",
"name": {{ . }}
Expand Down

0 comments on commit a1e9b05

Please sign in to comment.