From 0139cc0be1fe3c2f37a72babd6a1c4afac78dc3c Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 15 Apr 2020 20:32:38 +0800 Subject: SEO optimization --- README.md | 4 ++-- exampleSite/config.toml | 6 ++++++ exampleSite/static/img/og.png | Bin 0 -> 32206 bytes layouts/partials/head.html | 9 +++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 exampleSite/static/img/og.png diff --git a/README.md b/README.md index 25cd813..089d3a5 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ A minimal Hugo theme inspired by [printempw](https://github.com/printempw/)'s He ## Todo - [ ] Custom pagination -- [ ] Archive page +- [x] Archive page - [x] Analytics -- [ ] SEO optimization +- [x] SEO optimization - [ ] Better mobile devices support - [ ] Multilingual diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 7eb1fc1..fe8d9d7 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -13,8 +13,14 @@ paginate = 10 post = "/:filename/" # Custom post links, e.g. "/:year/:month/:title/" [params] + author = "DSRKafuU" # You can also set author in post front matter individually subTitle = "This is a Sub Title" + # Open Graph & Twitter Card variables + # You can also set description and images in post front matter individually + description = "A minimal hugo theme powered by Primer CSS." + images = ["img/og.png"] # This will use the image called og.png in static/img folder + # Posts shown in homepage mainSections = ["post"] diff --git a/exampleSite/static/img/og.png b/exampleSite/static/img/og.png new file mode 100644 index 0000000..894afe8 Binary files /dev/null and b/exampleSite/static/img/og.png differ diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0362712..df0f46a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -12,6 +12,15 @@ {{ else }} {{ .Title }} - {{ .Site.Title }} {{ end }} + + +{{ if .Params.tags }} + +{{ end }} + + +{{ template "_internal/opengraph.html" . }} +{{ template "_internal/twitter_cards.html" . }} {{ partial "analytic-google.html" . }} -- cgit v1.2.3