Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add description and keywords meta element that can be set at site OR page level

add lang and charset to the html element

update readme with blurb about setting meta values for description and keywords
  • Loading branch information
Dakota Brown committed Dec 22, 2020
1 parent bfd73a8 commit 79bc2c0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ theme = "dimension"

to `config.toml` file in your Hugo root directory and change params fields.

## SEO meta description and keywords
If you would like to set metadata keywords or descriptions, Just set in `config.toml`:

```
[params.meta]
description = "example meta description for SEO"
keywords = "example, tags, for, SOE"
```

or per-page in the .md files:

```
metaDescription = "example meta description for SEO"
metaKeywords = "example, tags, for, SOE"
```

**NOTE:** All the main page styling and configuration can be done by creating `_index.md` pages in the `content` folder and subdirectories. This choice was made to allow the use of any headless CMS (e.g. netlify) for total customization.

## Post archetype
Expand Down
5 changes: 4 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<!DOCTYPE html>
<html>
<html charset="utf-8" lang="{{ .Site.LanguageCode }}">
<head>
<title>{{ .Params.Title | default "Title" }}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<!-- allows you to set meta at page-level or site-level meta.description/meta.keywords if you want them-->
<meta name="description" content="{{ if .Params.metaDescription }}{{ .Params.metaDescription }}{{ else if .Site.Params.meta.description }}{{ .Site.Params.meta.description }}{{ else }}{{ end }}" />
<meta name="keywords" content="{{ if .Params.metaKeywords }}{{ .Params.metaKeywords }}{{ else if .Site.Params.meta.keywords }}{{ .Site.Params.meta.keywords }}{{ else }}{{ end }}" />
<link rel="stylesheet" href="{{ "assets/css/main.css" | absURL }}"/>
<noscript><link rel="stylesheet" href="{{ "assets/css/noscript.css" | absURL }}"/></noscript>
<style>
Expand Down

0 comments on commit 79bc2c0

Please sign in to comment.