jsonld

package
v0.0.0-...-da9e6da Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breadcrumb interface {
	Name() string
	URLPath() string
}

type ItemList

type ItemList struct {
	Context  string            `json:"@context"`
	Type     string            `json:"@type"`
	Elements []ItemListElement `json:"itemListElement"`
}
func BreadcrumbList[T Breadcrumb](urlprefix string, breadcrumbs []T) ItemList

See https://developers.google.com/search/docs/appearance/structured-data/breadcrumb

BreadcrumbList uses generics so we don't have to convert the slice from []SomeType to []Breadcrumb.

type ItemListElement

type ItemListElement struct {
	Type     string `json:"@type"`
	Position int    `json:"position"` // starting with 1
	Name     string `json:"name"`
	Item     string `json:"item,omitempty"` // URL
}

Jump to

Keyboard shortcuts

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