lists

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlogName

func GetBlogName(username string) string

func GetPostTitle

func GetPostTitle(post *db.Post) string

func KeyAsValue

func KeyAsValue(token *SplitToken) string

func NewConfigSite

func NewConfigSite() *shared.ConfigSite

func PublishAtDate

func PublishAtDate(date string) (*time.Time, error)

func SplitByNewline

func SplitByNewline(text string) []string

func StartApiServer

func StartApiServer()

func TokenToMetaField

func TokenToMetaField(meta *MetaData, token *SplitToken)

Types

type BlogPageData

type BlogPageData struct {
	Site      shared.SitePageData
	PageTitle string
	URL       template.URL
	RSSURL    template.URL
	Username  string
	Readme    *ReadmeTxt
	Header    *HeaderTxt
	Posts     []PostItemData
	HasFilter bool
}

type HeaderTxt

type HeaderTxt struct {
	Title    string
	Bio      string
	Nav      []*ListItem
	Layout   string
	HasItems bool
}

type ListHooks

type ListHooks struct {
	Cfg *shared.ConfigSite
	Db  db.DB
}

func (*ListHooks) FileMeta

func (p *ListHooks) FileMeta(data *filehandlers.PostMetaData) error

func (*ListHooks) FileValidate

func (p *ListHooks) FileValidate(data *filehandlers.PostMetaData) (bool, error)

type ListItem

type ListItem struct {
	Value       string
	URL         template.URL
	Variable    string
	IsURL       bool
	IsBlock     bool
	IsText      bool
	IsHeaderOne bool
	IsHeaderTwo bool
	IsImg       bool
	IsPre       bool
	Indent      int
}

type MetaData

type MetaData struct {
	PublishAt   *time.Time
	Title       string
	Description string
	Layout      string
	Tags        []string
	ListType    string // https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type
}

type ParsedText

type ParsedText struct {
	Items []*ListItem
	*MetaData
}

func ParseText

func ParseText(text string, linkify shared.Linkify) *ParsedText

type PostItemData

type PostItemData struct {
	URL            template.URL
	BlogURL        template.URL
	Username       string
	Title          string
	Description    string
	PublishAtISO   string
	PublishAt      string
	UpdatedAtISO   string
	UpdatedTimeAgo string
	Padding        string
}

type PostPageData

type PostPageData struct {
	Site         shared.SitePageData
	PageTitle    string
	URL          template.URL
	BlogURL      template.URL
	Title        string
	Description  string
	Username     string
	BlogName     string
	ListType     string
	Items        []*ListItem
	PublishAtISO string
	PublishAt    string
	Tags         []string
}

type ReadPageData

type ReadPageData struct {
	Site      shared.SitePageData
	NextPage  string
	PrevPage  string
	Posts     []PostItemData
	Tags      []string
	HasFilter bool
}

type ReadmeTxt

type ReadmeTxt struct {
	HasItems bool
	ListType string
	Items    []*ListItem
}

type SplitToken

type SplitToken struct {
	Key   string
	Value string
}

func TextToSplitToken

func TextToSplitToken(text string) *SplitToken

type TransparencyPageData

type TransparencyPageData struct {
	Site      shared.SitePageData
	Analytics *db.Analytics
}

Jump to

Keyboard shortcuts

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