Improve description for twitter cards and posts

This commit is contained in:
Djordje Atlialp 2021-01-10 16:04:23 +01:00
parent a46b6f6032
commit e3808bce7d
3 changed files with 15 additions and 5 deletions

View file

@ -52,6 +52,11 @@
}
}
&-excerpt {
color: grey;
font-style: italic;
}
&-info {
margin-top: 30px;
font-size: 0.8rem;

View file

@ -2,7 +2,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}">
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ if .Params.Description }}{{ .Params.Description }}{{ else }}{{ .Summary | plainify }}{{ end }}{{ end }}" />
<meta name="keywords" content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" />
<meta name="robots" content="noodp" />
<meta name="theme-color" content="{{ .Site.Params.themeColor }}" />
@ -37,6 +37,7 @@
{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/google_news.html" . }}
{{ if isset .Site.Taxonomies "series" }}
{{ template "_internal/opengraph.html" . }}

View file

@ -22,6 +22,14 @@
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
{{ with .Params.Description }}
<div class="post-excerpt">{{ . }}</div>
{{ end }}
{{ with .Params.Cover }}
<img src="/{{ . }}" class="post-cover" />
{{ end }}
{{- if .Params.toc }}
<hr />
<aside id="toc">
@ -31,10 +39,6 @@
<hr />
{{- end }}
{{ with .Params.Cover }}
<img src="/{{ . }}" class="post-cover" />
{{ end }}
<div class="post-content">
{{ .Content }}
</div>