favicon

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(r chi.Router, o Options) error

Add generates the favicons and adds the following routes to the passed chi.Router. It assumes the router represents the root of the domain.

  • apple-touch-icon.png
  • favicon.png
  • favicon-32x32.png
  • favicon-16x16.png
  • browserconfig.xml
  • mstile-150x150.png
  • site.webmanifest
  • android-chrome-512x512.png
  • android-chrome-192x192.png

Types

type Options

type Options struct {
	// Name is the name of the app as used for the webmanifest.
	Name string
	// ShortName is the short name of the app as used for the webmanifest.
	//
	// If empty, [Options.Name] will be used.
	ShortName string
	// The display mode as used in the webmanifest.
	//
	// Defaults to `standalone`.
	Display string
	// StartURL is the start URL as used in the webmanifest.
	StartURL string
	// ThemeColor is the theme color as used in the webmanifest.
	//
	// Defaults to `#ffffff`.
	ThemeColor string
	// BackgroundColor is the background color as used in the webmanifest.
	//
	// Defaults to `#ffffff`.
	BackgroundColor string

	// TileColor is the tile color as used in the browserconfig.
	//
	// Defaults to `#da532c`.
	TileColor string

	// Favicon is png-encoded base icon.
	Favicon []byte
	// AppleTouchIcon is an alternative icon used as the apple-touch-icon.
	//
	// If not set, [Options.Favicon] is used.
	AppleTouchIcon []byte
}

Jump to

Keyboard shortcuts

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