model

package
v0.0.0-...-cf4002c Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: EUPL-1.2 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	General struct {
		Loglevel string `toml:"loglevel"`
	} `toml:"general"`
	Features struct {
		Comments bool `toml:"comments"`
		Search   bool `toml:"search"`
		Columns  bool `toml:"columns"`
	} `toml:"features"`
	Server struct {
		Port int64  `toml:"port"`
		URL  string `toml:"url"`
	} `toml:"server"`
	Defaults struct {
		Author     string `toml:"author"`
		Language   string `toml:"language"`
		Dateformat string `toml:"dateformat"`
	} `toml:"defaults"`
	Blog struct {
		Title         string `toml:"title"`
		Stylesheet    string `toml:"stylesheet"`
		ContentBefore string `toml:"content-before"`
		ContentAfter  string `toml:"content-after"`
	} `toml:"blog"`
	Links map[string]string `toml:"links"`
}

Config gives structured access to config.toml

type EntryPage

type EntryPage struct {
	HeaderData Header
	Title      string
	Author     string
	Created    string
	Updated    string
	Columns    bool
	Contents   template.HTML
	FooterData Footer
}

EntryPage template data

type Feed

type Feed struct {
	Title   string
	Lang    string
	URL     string
	Time    string
	Author  string
	Entries []FeedEntry
}

Feed template data for atom feed

type FeedEntries

type FeedEntries []FeedEntry

FeedEntries are FeedEntry as a collection that implements sortable

func (FeedEntries) Len

func (p FeedEntries) Len() int

func (FeedEntries) Less

func (p FeedEntries) Less(i, j int) bool

func (FeedEntries) Swap

func (p FeedEntries) Swap(i, j int)

type FeedEntry

type FeedEntry struct {
	SortDate    time.Time
	Entrytitle  string
	Entryauthor string
	URL         string
	Date        string
	ID          string
	Entrytime   string
	Pubdate     string
	Contents    string
}

FeedEntry is template data of feed entries

type Footer struct {
	CustomContent template.HTML
}

Footer template data

type Header struct {
	Lang          string
	Stylesheet    string
	Title         string
	Author        string
	Description   string
	Links         []Link
	Linklen       int
	SearchEnabled bool
	CustomContent template.HTML
}

Header template data

type IndexPage

type IndexPage struct {
	HeaderData Header
	Entries    []Link
	FooterData Footer
}

IndexPage template data

type Link struct {
	SortDate time.Time
	Linkdate string
	Linktext string
	Linkurl  string
}

Link represents a hyperlink, dates are optional

type Links []Link

Links are a link collection that implements sortable

func (Links) Filter

func (p Links) Filter(f string) []Link

Filter links case-insensitive with string f

func (Links) Len

func (p Links) Len() int

func (Links) Less

func (p Links) Less(i, j int) bool

func (Links) Swap

func (p Links) Swap(i, j int)

Jump to

Keyboard shortcuts

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