diff options
author | amzrk2 | 2020-04-15 20:32:38 +0800 |
---|---|---|
committer | amzrk2 | 2020-04-15 20:32:38 +0800 |
commit | 0139cc0be1fe3c2f37a72babd6a1c4afac78dc3c (patch) | |
tree | 31a109b4a7026d03120684db0fe0e0262a9234a7 | |
parent | ea560a0610991ce5af7fabef9e5ef456f374b8e4 (diff) | |
download | hugo-theme-fuji-0139cc0be1fe3c2f37a72babd6a1c4afac78dc3c.tar.gz hugo-theme-fuji-0139cc0be1fe3c2f37a72babd6a1c4afac78dc3c.tar.bz2 hugo-theme-fuji-0139cc0be1fe3c2f37a72babd6a1c4afac78dc3c.zip |
SEO optimization
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | exampleSite/config.toml | 6 | ||||
-rw-r--r-- | exampleSite/static/img/og.png | bin | 0 -> 32206 bytes | |||
-rw-r--r-- | layouts/partials/head.html | 9 |
4 files changed, 17 insertions, 2 deletions
@@ -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 Binary files differnew file mode 100644 index 0000000..894afe8 --- /dev/null +++ b/exampleSite/static/img/og.png 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>{{ .Title }} - {{ .Site.Title }}</title> {{ end }} +<meta name="author" content="{{if .Params.author }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}"> +<meta name="description" content="{{if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.description }}{{ end }}"> +{{ if .Params.tags }} +<meta name="keywords" content="{{ delimit .Params.tags ", " }}"> +{{ end }} + + +{{ template "_internal/opengraph.html" . }} +{{ template "_internal/twitter_cards.html" . }} {{ partial "analytic-google.html" . }} |