ogp

package module
v0.0.0-...-8f6bcb7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 3 Imported by: 0

README

Go Types for Open Graph Metadata

Package ogp provides types that represent Open Graph metadata.

Documentation

Overview

Package ogp provides types that represent Open Graph metadata. https://ogp.me/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audio

type Audio struct {
	URL       URL
	SecureURL SecureURL
	Type      string
}

type Determiner

type Determiner string
const (
	DetBlank Determiner = ""
	DetAuto  Determiner = "auto"
	DetA     Determiner = "a"
	DetAn    Determiner = "an"
	DetThe   Determiner = "the"
)

type Image

type Image struct {
	URL       URL
	SecureURL SecureURL
	Type      string
	Width     int
	Height    int
	Alt       string
}

type Locale

type Locale string
const (
	LocEnUS Locale = "en_US"
)

type OpenGraph

type OpenGraph struct {
	// Basic
	Title  string
	Type   string
	Image  URL // Ignored if Images is set.
	Images []Image
	URL    URL

	// Optional
	Audio           URL
	Description     string
	Determiner      Determiner
	Locale          Locale
	LocaleAlternate []Locale
	SiteName        string
	Video           URL
}

func (OpenGraph) HTML

func (o OpenGraph) HTML() template.HTML

type SecureURL

type SecureURL URL

func (SecureURL) IsValid

func (s SecureURL) IsValid() bool

type URL

type URL string

func (URL) IsValid

func (u URL) IsValid() bool

type Video

type Video struct {
	URL       URL
	SecureURL SecureURL
	Type      string
	Width     int
	Height    int
}

Jump to

Keyboard shortcuts

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