Stone.js API
    Preparing search index...

    Function applyElementAttributes

    Head/meta management API for React pages, re-exported from the agnostic @stone-js/use-view layer so users import everything from @stone-js/use-react.

    import { createHead } from '@stone-js/use-react'

    class BlogPost implements IPage<ReactIncomingEvent> {
    head ({ data }) {
    return createHead()
    .title(data.post.title)
    .titleTemplate('%s — Stone.js')
    .description(data.post.excerpt)
    .canonical(`https://stonejs.dev/blog/${data.post.slug}`)
    .og({ type: 'article', image: data.post.cover, siteName: 'Stone.js' })
    .twitter({ card: 'summary_large_image', site: '@stonejs' })
    .jsonLd({ '@context': 'https://schema.org', '@type': 'Article', headline: data.post.title })
    .toContext()
    }
    render ({ data }) { return <article>{data.post.body}</article> }
    }
    • Apply an attribute map to an element (used for <html> / <body> attributes).

      Parameters

      • element: Element

        The target element (no-op when null).

      • Optionalattributes: Record<string, string>

        The attribute map (no-op when undefined).

      Returns void