Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/austingebauer/devise.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Gebauer <agebauer@hashicorp.com>2020-09-14 02:43:04 +0300
committerAustin Gebauer <agebauer@hashicorp.com>2020-09-14 02:43:04 +0300
commit268725dc5c6cbf2a26f083f34ad0291e431c42c5 (patch)
tree641ebbf6914492d562105ac59f777f1944b27484
parent05610d758c57d0668b982d4cbf2781c28e04b589 (diff)
adds ability to set meta descriptions for search from config file or content front matter
-rw-r--r--README.md2
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/head.html1
3 files changed, 4 insertions, 0 deletions
diff --git a/README.md b/README.md
index 91fd73b..de80880 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ For a live demo of the theme, see at:
- Ability to use [Font Awesome](https://fontawesome.com/) icons
- Ability to customize the theme styles via [Sass](https://sass-lang.com/)
- Ability to customize the following items via Hugo [configuration](https://gohugo.io/getting-started/configuration/) file
+ - Meta description
- Title
- Subtitle
- Image
@@ -85,6 +86,7 @@ copyright = "&copy; Copyright Year, Your Name"
# Configuration Features
[params]
+ description = "Your meta description" # Your meta description of the site
header_title = "Your Name" # Your header title
header_subtitle = "Your Creative Subtitle" # Your header subtitle
home_image = "/images/avatar.png" # Path to header image starting from the static directory
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 0e56560..95b0dae 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -31,6 +31,7 @@ copyright = "&copy; Copyright Year, Your Name"
# Configuration Features
[params]
+ description = "Your meta description" # Your meta description of the site
header_title = "Your Name" # Your header title
header_subtitle = "Your Creative Subtitle" # Your header subtitle
home_image = "/images/avatar.png" # Path to header image starting from the static directory
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 92b2718..41b5754 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -2,6 +2,7 @@
<title>{{ .Title }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
{{/* Adds complete override capability */}}
{{ $overrideTemplate := resources.Get "sass/override.scss" }}