{{- $description := .Description | default .Params.description | default .Summary | default .Site.Params.description | default .Site.Title -}}
{{- $keywords := delimit (.Keywords | default .Site.Params.keywords | default (slice)) ", " -}}
{{- $author := .Params.author | default .Site.Params.author | default .Site.Title -}}
{{- $robots := .Params.robots | default "index, follow" -}}
{{- $canonical := .Permalink | default .RelPermalink -}}

<!-- Primary Meta Tags -->
<meta name="description" content="{{ $description }}">
<meta name="keywords" content="{{ $keywords }}">
<meta name="author" content="{{ $author }}">
<meta name="robots" content="{{ $robots }}">
<meta name="generator" content="Hugo {{ hugo.Version }}">

<!-- Canonical URL -->
<link rel="canonical" href="{{ $canonical }}">

<!-- Theme Color -->
<meta name="theme-color" content="{{ .Site.Params.seo.theme_color | default "#007bff" }}">
<meta name="msapplication-TileColor" content="{{ .Site.Params.seo.theme_color | default "#007bff" }}">

<!-- Additional SEO -->
<meta name="rating" content="general">
<meta name="language" content="{{ .Site.Language.Lang | default "en" }}">
<meta name="revisit-after" content="7 days">
<meta name="distribution" content="global">
<meta name="web_author" content="{{ .Site.Params.author | default .Site.Title }}">

<!-- Geo Tags (if location is specified) -->
{{ with .Site.Params.seo.geo }}
<meta name="geo.region" content="{{ .region }}">
<meta name="geo.placename" content="{{ .placename }}">
<meta name="geo.position" content="{{ .latitude }};{{ .longitude }}">
<meta name="ICBM" content="{{ .latitude }}, {{ .longitude }}">
{{ end }}

<!-- Dublin Core -->
<meta name="DC.Title" content="{{ .Title | default .Site.Title }}">
<meta name="DC.Creator" content="{{ $author }}">
<meta name="DC.Description" content="{{ $description }}">
<meta name="DC.Language" content="{{ .Site.Language.Lang | default "en" }}">
