website

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SubDir      = ""
	UseTagIndex = false
)
View Source
var EnableSearch = false

EnableSearch enables the search functionality.

View Source
var Templates fs.FS

Templates is an optional set of templates to use.

Functions

func BuiltInTemplates added in v1.2.0

func BuiltInTemplates() embed.FS

BuiltInTemplates returns the built-in templates.

func Content

func Content(data *twitwoo.Data, pd PageData, fn contentFunc, w io.Writer) error

Content renders a page containing custom content.

func FuncMap

func FuncMap(m *twitwoo.Manifest) template.FuncMap

FuncMap returns a template.FuncMap for use in the website templates.

func Index

func Index(data *twitwoo.Data, page, pageSize int64, w io.Writer) error

Index write a page of multiple items.

func Page

func Page(data *twitwoo.Data, id int64, w io.Writer) error

Page writes a single item page.

func ProfileMediaPath

func ProfileMediaPath(accountID int64, mediaURL string) string

ProfileMediaPath returns the path to the media for the given profile ID and media URL.

func Stylesheet added in v1.1.0

func Stylesheet(data *twitwoo.Data, w io.Writer) error

Stylesheet writes the stylesheet to the given writer.

func Tweet

func Tweet(data *twitwoo.Data, tw *twitwoo.Tweet, w io.Writer) error

Tweet renders a singular tweet without wrapper HTML for the rest of a page.

func TweetMediaPath

func TweetMediaPath(tweetID int64, media twitwoo.Media) string

TweetMediaPath returns the path to the media file for the given tweet ID and media URL.

Types

type PageData

type PageData struct {
	Profile    *twitwoo.Profile
	PrevPage   string
	NextPage   string
	UserInfo   twitwoo.UserInfo
	Page       int64
	PageSize   int64
	PageCount  int64
	TweetCount int64
}

Jump to

Keyboard shortcuts

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