diff --git a/lib/template.html b/lib/template.html index fb14581..cc50943 100644 --- a/lib/template.html +++ b/lib/template.html @@ -1,5 +1,9 @@ +{% if page.url == "/" or page.url == "/about/" %} + {% assign seo_homepage_or_about = true %} +{% endif %} + {% if site.url %} {% assign seo_url = site.url | append: site.baseurl %} {% endif %} @@ -22,6 +26,17 @@ {% endif %} {% endif %} +{% if page.seo and page.seo.name %} + {% assign seo_name = page.seo.name %} +{% elsif seo_homepage_or_about and site.social and site.social.name %} + {% assign seo_name = site.social.name %} +{% elsif seo_homepage_or_about and seo_site_title %} + {% assign seo_name = seo_site_title %} +{% endif %} +{% if seo_name %} + {% assign seo_name = seo_name | markdownify | strip_html | strip_newlines | escape_once %} +{% endif %} + {% if seo_title %} {% assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once %} {% endif %} @@ -53,6 +68,22 @@ {% assign seo_author_twitter = seo_author_twitter | replace:"@","" %} {% endif %} +{% if page.seo and page.seo.type %} + {% assign seo_type = page.seo.type %} +{% elsif seo_homepage_or_about %} + {% assign seo_type = "WebSite" %} +{% elsif page.date %} + {% assign seo_type = "BlogPosting" %} +{% else %} + {% assign seo_type = "WebPage" %} +{% endif %} + +{% if page.seo and page.seo.links %} + {% assign seo_links = page.seo.links %} +{% elsif seo_homepage_or_about and site.social and site.social.links %} + {% assign seo_links = site.social.links %} +{% endif %} + {% if seo_tag.title and seo_title %}