Adds social media meta tags and new param for featured images

This commit is contained in:
Josh Johnson 2024-02-19 22:19:19 -05:00
parent 830ad5392b
commit cde5d340bd
3 changed files with 21 additions and 3 deletions

View file

@ -6,17 +6,27 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="{{ with .Site.Author.firstname }}{{ . }}{{ end }} {{ with .Site.Author.lastname }}{{ . }}{{ end }}">
<meta name="description" content="{{ with .Site.Params.description }}{{ . }}{{ end }}">
{{ hugo.Generator }}
{{ $siteTitle := .Site.Title }} {{ $title := $siteTitle }}{{ if .IsPage }}{{ $title = .Title }}
<meta property="og:type" content="article" />
<meta property="og:title" content="{{ $title }}">
{{ if .Param "feature" }}<meta property="og:image" content="{{ .Site.BaseURL }}{{ .Params.feature }}">{{ end }}
<meta property="og:url" content="{{ .Page.Permalink }}">
<meta property="og:description" content="{{ .Summary }}">
<meta property="og:site_name" content="@{{ .Site.Author.handle }}s {{ .Site.Title }}">
<meta name="twitter:card" content="summary_large_image">
{{ end }}
{{ hugo.Generator }}
{{ $.Scratch.Add "title" .Site.Title }}
<title>{{ with .Title }}{{ if ne . ($.Scratch.Get "title") }}{{ . }} &middot; {{ end }}{{ end }}@{{ .Site.Author.handle }}s {{ .Site.Title }}</title>
<link rel="stylesheet" href="{{.Site.BaseURL}}css/weblog.css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.2.14/css/lightgallery.min.css" type="text/css" />
{{ partial "custom_stylesheets.html" . }}
{{ if .Site.Params.rssenabled }}
<link href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" rel="alternate" type="application/rss+xml" title="{{.Site.Title}}" />
<link href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" rel="alternate" type="application/rss+xml" title="{{.Site.Title}}" />
{{ end }}
</head>
<body class="site">