Skip to content

Overriding index directive for certain page #608

Open
@MattDodsonEnglish

Description

@MattDodsonEnglish

Feature Description
Add a frontmatter parameter that provides a way to add a noindex tag.

Problem/Solution

It's possible to add custom headers using the partials/custom/head-end.html.
However, using this to add a nonindex tag would conflict with the main head.html partial:

{{ if hugo.IsProduction -}}
    <meta name="robots" content="index, follow" />

Alternatives Considered

  • Use Robots.txt, though as I understand some pages might get indexed if they are linked
  • accept the conflict
  • overwrite the current head partial

Additional Context

Duplicate content for versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions