renderer

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaData

type MetaData struct {
	Description string
	Keywords    string
	Charset     string
}

MetaData is the structure for the meta-tags.

type RandomTopic

type RandomTopic struct {
	Topic string
	Link  string
}

RandomTopic is the structure for the RandomTopic.

type RenderData

type RenderData struct {
	NewsAnchor    string
	Headline      string
	Content       template.HTML
	FollowUpLink  template.HTML
	HeadlineLinks []string
	RandomTopics  []RandomTopic
	Year          string
	CurrentYear   string
	MetaData      MetaData
	LanguageCode  string
}

RenderData is the structure for the RenderData.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer is the structure for the Renderer.

func NewRenderer

func NewRenderer(ctx context.Context, logger *slog.Logger, headLineLinks []string) *Renderer

func (*Renderer) RenderInRandomTemplate

func (r *Renderer) RenderInRandomTemplate(ctx context.Context, rd RenderData) (string, error)

RenderInRandomTemplate renders the given text in a random template using go templates.

func (*Renderer) SetTemplates added in v0.3.2

func (r *Renderer) SetTemplates(templates []string)

SetTemplates sets the templates, at the moment only used for testing.

Jump to

Keyboard shortcuts

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