diff options
author | Robert Austin <rob@jugglerdigital.com> | 2019-03-01 04:50:05 +0300 |
---|---|---|
committer | Robert Austin <rob@jugglerdigital.com> | 2019-03-01 04:50:05 +0300 |
commit | df5531fd808473d4507a2b4e0d01ecf0d74d6026 (patch) | |
tree | 6eefa2100fd75b93a88f04329746dc7ab1f3ce5e /README.md | |
parent | ba4d04557dc975ad34a4acbff3f23287b0339122 (diff) |
add configurable meta-tags
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -67,3 +67,42 @@ hugo server ``` Now enter [`localhost:1313`](http://localhost:1313) in the address bar of your browser. + +# Configuring theme features + +### Homepage meta tags + +Often a homepage requires special meta tags such as a meta description or og meta data for twitter, facebook etc. You can configure these values in the `config.toml` + +``` +// config.toml +[params] + google_analytics_id="" + + [params.homepage_meta_tags] + meta_description = "a description of your website." + meta_og_title = "My Theme" + meta_og_type = "website" + meta_og_url = "https://www.mywebsite.com" + meta_og_image = "https://www.mywebsite.com/images/tn.png" + meta_og_description = "a description of your website." + meta_twitter_card = "summary" + meta_twitter_site = "@mytwitterhandle" + meta_twitter_creator = "@mytwitterhandle" +``` + +### Set meta tags on a per template/page basis + +You can set meta tags on a per template basis using a block. For example, you might want to write a custom meta description for the `/services` page. You can insert any valid HTML meta data inside the `{{ define "meta_tags }}` block at the top of a template. + +``` +// layouts/services/list.html +... + +{{ define "meta_tags" }} + <meta name="description" content="We offer a variety of services in the finance industry" /> +{{ end }} + +{{ define main }} +... +``` |