From b8c709e73559476677dfcd1c5ab4d33856d7c751 Mon Sep 17 00:00:00 2001 From: Alexandre Vicenzi Date: Mon, 10 Feb 2020 21:30:40 +0100 Subject: [PATCH] SEO --- README.md | 17 +++++++- layouts/_default/baseof.html | 29 +++++++++---- layouts/partials/seo.html | 81 ++++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 9 deletions(-) create mode 100644 layouts/partials/seo.html diff --git a/README.md b/README.md index bcfd73e..c892e1f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,21 @@ Lanyon is a minimalist two-column [hugo](https://gohugo.io) theme based on [Hyde ![Screenshot](https://raw.githubusercontent.com/alexandrevicenzi/lanyon/master/images/tn.png) +## Features + +- Mobile First +- Responsive +- Semantic +- SEO Best Practices +- Open Graph +- Rich Snippets (JSON-LD) +- Customizable + +## Integrations + +- [Disqus](https://disqus.com/) +- [Google Analytics](https://www.google.com/analytics/web/) + ## Installation To install Lanyon as your default theme, first install this repository in the `themes/` directory: @@ -22,7 +37,6 @@ at the top of the file. ```toml baseURL = "https://example.com" title = "Lanyon" -author = "Author Name" languageCode = "en" enableInlineShortcodes = true @@ -30,6 +44,7 @@ summarylength = 10 enableEmoji = true [params] +author = "Author Name" description = "My Blog" ## Set one of: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 658c98e..194b19a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,10 +2,8 @@ - - {{ hugo.Generator }} - + {{ hugo.Generator }} {{ if .IsHome -}} {{ .Site.Title }} @@ -15,9 +13,20 @@ - - - + {{ partial "seo.html" . }} + + + + + + {{ partial "theme-color.html" . }} @@ -25,14 +34,18 @@ {{- end}} - + - + + diff --git a/layouts/partials/seo.html b/layouts/partials/seo.html new file mode 100644 index 0000000..46b0c29 --- /dev/null +++ b/layouts/partials/seo.html @@ -0,0 +1,81 @@ + + + + {{ with .Site.Params.gravatar }} + + {{- else -}} + {{ with .Site.Params.profilePicture }} + + {{- end -}} + {{ end }} + + {{ if eq .Type "post" }} + + + + + + + + + + + {{ else }} + + + + {{- if .IsHome }} + + + + {{- else -}} + + + + {{- end -}} + + {{ end }} + + + + {{ if eq .Type "post" }} + + {{ end }}