Generates robots meta tags for the HTML head section.

Controls how search engines crawl and index your pages. Supports both traditional robots directives and modern Google-specific directives.

import { robots } from '@raven-js/beak/seo';

// Basic robots tag
const tags = robots({
index: true,
follow: true
});
// Output:
// <meta name="robots" content="index, follow" />

// Prevent indexing
const noIndexTags = robots({
index: false,
follow: false
});
// Output:
// <meta name="robots" content="noindex, nofollow" />
  • Parameters

    • config: RobotsConfig

      Configuration object for robots tags

    Returns string

    The generated robots meta tags as an HTML string