diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | exampleSite/config.toml | 5 | ||||
| -rw-r--r-- | layouts/partials/head.html | 3 | ||||
| -rw-r--r-- | layouts/partials/keywords.html | 5 |
4 files changed, 13 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a5eaa3b..0e8f276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add Russian translation - Provide an ability to use hreflang attribute in raw links - Add `{{< mini-toc >}}` shortcode +- Provide an ability to use `keywords` meta tag ### Changed diff --git a/exampleSite/config.toml b/exampleSite/config.toml index e2982d9..b19be14 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -135,6 +135,9 @@ disableKinds = ['RSS'] [params] # Site description. Used in meta description description = 'Ed is a Hugo theme designed for textual editors based on minimal computing principles, and focused on legibility and flexibility.' + # SEO keywords. Used in 'meta name="keywords"' tag. + # May be overridden by page tags. + seoKeywords = ['hugo', 'ed', 'hugo theme', 'minimal', 'responsive', 'clean'] # Copyright string. "{year}" will be replaced by © and the current year. copyright = 'Copyright © 2019-{year} John Doe' # Color scheme. Options: red, orange, magenta, cyan, blue, brown @@ -149,7 +152,7 @@ disableKinds = ['RSS'] # Order of post meta information postMeta = ['date'] # Posts date format, for example: 2006-01-02 - dateformat = 'January 02, 2006' + dateformat = ':date_long' dateFormatToc = '2006.01.02' dateFormatFeed = '2006-01-02T15:04:05Z07:00' dateFormatRFC822Z = '02 Jan 2006 15:04:05 UT' diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 24fd6f9..14cd475 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,6 +7,9 @@ <title>{{ block "title" . }}{{- partial "title.html" . -}}{{ end }}</title> <meta name="description" content="{{ (partial "description.html" . ) }}"> + {{ if or .Params.tags site.Params.seoKeywords }} + <meta name="keywords" content="{{ (partial "keywords.html" . ) }}"> + {{ end }} <meta name="author" content="{{ (partial "author.html" . ) }}"> {{ hugo.Generator }} diff --git a/layouts/partials/keywords.html b/layouts/partials/keywords.html new file mode 100644 index 0000000..a25be75 --- /dev/null +++ b/layouts/partials/keywords.html @@ -0,0 +1,5 @@ +{{- if .Params.tags -}} + {{- delimit .Params.tags ", " -}} +{{- else -}}{{ site.Params.keywords }} + {{- delimit site.Params.seoKeywords ", " -}} +{{- end -}} |
