seo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package seo provides SEO meta tag and structured data management for ForgeUI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlternateLink(lang, url string) templ.Component

AlternateLink generates an alternate language link tag.

func DNSPrefetch

func DNSPrefetch(url string) templ.Component

DNSPrefetch generates a DNS prefetch link tag.

func GenerateSitemap

func GenerateSitemap(urls []SitemapURL) string

GenerateSitemap generates a basic sitemap structure.

func JSONLDNode

func JSONLDNode(data StructuredData) templ.Component

JSONLDNode generates JSON-LD structured data node.

func MetaTagsNode

func MetaTagsNode(tags MetaTags) templ.Component

MetaTagsNode generates meta tag nodes.

func Preconnect

func Preconnect(url string) templ.Component

Preconnect generates a preconnect link tag for external domains.

func RSSLink(title, url string) templ.Component

RSSLink generates an RSS feed link tag.

func SitemapLink(url string) templ.Component

SitemapLink generates a sitemap link tag.

Types

type BreadcrumbItem struct {
	Name string
	URL  string
}

BreadcrumbItem represents a breadcrumb item.

type MetaTags

type MetaTags struct {
	Title       string
	Description string
	Keywords    []string
	Author      string
	Canonical   string

	OGTitle       string
	OGDescription string
	OGImage       string
	OGType        string
	OGURL         string
	OGSiteName    string

	TwitterCard        string
	TwitterSite        string
	TwitterCreator     string
	TwitterTitle       string
	TwitterDescription string
	TwitterImage       string

	Robots    string
	GoogleBot string
	BingBot   string
}

MetaTags contains SEO meta tag configuration.

func DefaultMetaTags

func DefaultMetaTags() MetaTags

DefaultMetaTags returns default meta tags.

type SEO

type SEO struct {
	*plugin.PluginBase
}

SEO plugin.

func New

func New() *SEO

New creates a new SEO plugin.

func (*SEO) Init

func (s *SEO) Init(ctx context.Context, registry *plugin.Registry) error

Init initializes the SEO plugin.

func (*SEO) Shutdown

func (s *SEO) Shutdown(ctx context.Context) error

Shutdown cleanly shuts down the plugin.

type SitemapURL

type SitemapURL struct {
	Loc        string
	LastMod    string
	ChangeFreq string
	Priority   float64
}

SitemapURL represents a URL in a sitemap.

type StructuredData

type StructuredData struct {
	Type string
	Data map[string]any
}

StructuredData contains JSON-LD structured data.

func ArticleSchema

func ArticleSchema(headline, description, image, datePublished, author string) StructuredData

ArticleSchema creates Article structured data.

func BreadcrumbSchema(items []BreadcrumbItem) StructuredData

BreadcrumbSchema creates BreadcrumbList structured data.

func OrganizationSchema

func OrganizationSchema(name, url, logo string) StructuredData

OrganizationSchema creates Organization structured data.

Jump to

Keyboard shortcuts

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