meta

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Author

func Author(content string) *element

Author Creates a meta author element to identify the document's author. Example: meta.Author("John Doe") Renders: <meta name="author" content="John Doe" />

func Charset

func Charset(charset charset.Charset) *element

Charset Creates a new meta element declaring character encoding. Example: meta.Charset(charset.Custom("custom")) Renders: <meta charset="custom" />

func Description

func Description(content string) *element

Description Creates a meta description element for SEO and search engine snippets. Example: meta.Description("Page description") Renders: <meta name="description" content="Page description" />

func Keywords

func Keywords(content string) *element

Keywords Creates a meta keywords element (largely deprecated for SEO). Example: meta.Keywords("html, css, javascript") Renders: <meta name="keywords" content="html, css, javascript" />

func New

func New() *element

New Creates a new meta element without any initial attributes. Example: meta.New() Renders: <meta />

func OG

func OG(property string, content string) *element

OG Creates a new meta element for Open Graph protocol properties (social media sharing). Example: meta.OG("title", "My Page Title") Renders: <meta content="My Page Title" property="title" />

func Refresh

func Refresh(seconds int, url string) *element

Refresh Creates a meta refresh element that automatically redirects after specified seconds. Example: meta.Refresh(5, "/new-page") Renders: <meta content="5; url=/new-page" httpequiv="refresh" />

func Robots

func Robots(content string) *element

Robots Creates a meta robots element to control search engine crawling and indexing. Example: meta.Robots("index, follow") Renders: <meta name="robots" content="index, follow" />

func UTF8

func UTF8() *element

UTF8 Creates a UTF-8 charset meta element (recommended encoding). Example: meta.UTF8() Renders: <meta charset="UTF-8" />

func Viewport

func Viewport(content string) *element

Viewport Creates a new meta element for viewport configuration on mobile devices. Example: meta.Viewport("width=device-width, initial-scale=1.0") Renders: <meta name="viewport" content="width=device-width, initial-scale=1.0" />

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL