nodejh/hugo-theme-mini

Metadata description is for site not page

PreciousChicken opened this issue · 0 comments

Describe the issue

The metadata attribute description used in the HTML <head> is defined in the HTML Living Standard as:

a free-form string that describes the page. The value must be appropriate for use in a directory of pages, e.g. in a search engine.

However the attribute currently uses the description for the site. If the author provides a description value within the front matter for the page, this is ignored.

To Reproduce

Add the following line to the front matter of a page where you wish to provide a description:

description: "Lorem ipsum dolor sit amet"

Run hugo: hugo server -D

Expected behaviour

The HTML outputted should be:

<head>
<!-- More html here... -->
<meta name="description" content="Lorem ipsum dolor sit amet" />
<!-- More html here... -->
</head>

Screenshots

None.

Configuration:

  • OS: Ubuntu 20.04.1 LTS
  • Hugo: v0.80.0

Additional context

I am happy to submit a pull request to fix this. I suspect however that this repo is no longer maintained, but adding the issue anyway just in case.

I've blogged on how I fixed this issue in my clone of this repo:

On metadata in Hugo - or turning tags to keywords

This also includes how I added metadata for keywords and canonical links (probably less of an issue for most people).