diff options
author | MaoMao <maomao8017@gmail.com> | 2020-04-27 01:09:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 01:09:55 +0300 |
commit | 7724fa76ac63432addde8b8dea888eea3b72204d (patch) | |
tree | a0d66fe0a3fb15200b771f04bd1b1b30486f64cd | |
parent | 8ec09e5d1af4eddbcb73def6bed9f0d7248315dd (diff) |
Support SEO friendly meta tags (#300)
* Support two SEO friendly tags: <meta name="description"> and <meta name="keywords">.
* Support two SEO friendly tags: <meta name="description"> and <meta name="keywords">.
-rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2254e57..3c3c536 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -64,3 +64,4 @@ - [Santiago González](https://github.com/netrules) - [Codruț Constantin Gușoi](https://www.sdwolfz.pro) - [Clément Pannetier](https://clementpannetier.dev) +- [FantasticMao](https://github.com/FantasticMao) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 687dc10..362833d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -6,8 +6,8 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }} - {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }} - {{ with .Site.Params.keywords }}<meta name="keywords" content="{{ . }}">{{ end }} + <meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}"> + <meta name="keywords" content="{{ (delimit .Keywords ",") | default .Site.Params.keywords }}"> {{ template "_internal/twitter_cards.html" . }} {{ template "_internal/opengraph.html" . }} |