seo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0, MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package seo checks the search-engine and social metadata of an export.

static.New(app, static.Checks(seo.Preset()))

Preset checks every exported 200 HTML page that is not marked noindex: the required head tags, unique titles and descriptions, a canonical URL equal to the page's own URL, an og:image that is in the export at the expected size, sitemap coverage, and JSON-LD that parses. Each problem is an error diagnostic, so it fails the export unless --allow names its code.

Index

Constants

View Source
const (
	CodeMissingTag           = "SEO001" // a required head tag is missing or empty
	CodeDuplicateTitle       = "SEO002" // two pages share a <title>
	CodeDuplicateDescription = "SEO003" // two pages share a meta description
	CodeCanonical            = "SEO004" // the canonical URL is not the page's URL
	CodeOGImage              = "SEO005" // og:image is missing from the export, the wrong size, or too large
	CodeSitemap              = "SEO006" // the page is not in the sitemap
	CodeJSONLD               = "SEO007" // a JSON-LD block does not parse
)

Diagnostic codes.

Variables

This section is empty.

Functions

func Preset

func Preset(opts ...Option) static.Check

Preset returns the SEO check, for static.Checks.

Types

type Option

type Option func(*config)

Option configures Preset.

func ImageSize

func ImageSize(width, height int) Option

ImageSize sets the pixel size a same-origin og:image must have. Default 1200x630.

func MaxImageBytes

func MaxImageBytes(n int) Option

MaxImageBytes sets the largest og:image file size allowed. Default 300,000 bytes.

Jump to

Keyboard shortcuts

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