webstyle

package
v0.0.0-...-ff1ddd2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TemplateFull    = template.Must(templateBase.New("").Parse(layoutTpl))
	TemplateCompact = template.Must(templateCompact.New("").Parse(layoutTpl))
)

Functions

func Structured

func Structured(w io.Writer, o Options) error

Types

type Data

type Data struct {
	Main string

	// Optional
	Style    string
	Title    string // defaults to h1
	Subtitle string // defaults to h2
	Desc     string // defaults to subtitle
	Head     string
	GTM      string
	URL      string
}

Data holds the metadata to render a given page

type Options

type Options struct {
	Gtag         string
	CanonicalURL string
	Manifest     string
	CompactStyle bool
	CustomCSS    string
	Minify       bool

	Title       string // title, h1
	Subtitle    string // link home, h2
	Description string // meta description

	Content []gomponents.Node

	FooterLinks []OptionsFooter
}

func NewOptions

func NewOptions(site, title string, content []gomponents.Node) Options

type OptionsFooter

type OptionsFooter struct {
	Name string
	URL  string
}

type Renderer

type Renderer struct {
	Template *template.Template
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(t *template.Template) Renderer

NewRenderer creates a rendered with default options

func (Renderer) Render

func (r Renderer) Render(w io.Writer, src io.Reader, d Data) error

func (Renderer) RenderBytes

func (r Renderer) RenderBytes(src []byte, d Data) ([]byte, error)

Directories

Path Synopsis
picture is a goldmark extension to render images as html picture blocks instead of img tags in a paragraph
picture is a goldmark extension to render images as html picture blocks instead of img tags in a paragraph
webstatic is an filesystem for common static files needed across html pages.
webstatic is an filesystem for common static files needed across html pages.

Jump to

Keyboard shortcuts

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