Skip to content

Commit

Permalink
fix: meta description
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-sid committed Feb 14, 2023
1 parent 6464c5d commit 340bd14
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions layouts/partials/meta/standard.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@
<meta name="application-name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta property="og:site_name" content="{{ .Site.Params.sitename }}" />

<meta name="description" content="{{ if .Params.Description }}{{ trim .Params.Description "\n" }}{{else if .Site.Params.Description}}{{ trim .Site.Params.Description "\n"}}{{ end }}">
<meta itemprop="description" content="{{ .Params.description }}" />
<meta property="og:description" content="{{ .Params.description }}" />
<meta name="twitter:description" content="{{ .Params.description }}" />
{{/* Define empty variable description */}}
{{- $description := "" -}}

{{/* If description is defined in front matter, use it */}}
{{- if .Params.description -}}
{{- $description = trim .Params.description "\n" -}}
{{/* If description is not defined in front matter, use site description */}}
{{- else if .Site.Params.description -}}
{{- $description = trim .Site.Params.description "\n" -}}
{{- end -}}

<meta name="description" content="{{ $description }}">
<meta itemprop="description" content="{{ $description }}" />
<meta property="og:description" content="{{ $description }}" />
<meta name="twitter:description" content="{{ $description }}" />

<meta property="og:locale" content="{{ .Site.LanguageCode }}" />
<meta name="language" content="{{ .Site.LanguageCode }}" />
Expand Down

0 comments on commit 340bd14

Please sign in to comment.