model

package
v0.0.0-...-c788040 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFooter = `Powered by [🐼](https://github.com/fishy/pandablog), theme by [🐻](https://bearblog.dev/)`

DefaultFooter is the default Footer.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Title     string    `json:"title"`
	URL       string    `json:"url"`
	Alias     string    `json:"alias"`
	Canonical string    `json:"canonical"`
	Created   time.Time `json:"created"`
	Updated   time.Time `json:"updated"`
	Timestamp time.Time `json:"timestamp"`
	Content   string    `json:"content"`
	Published bool      `json:"published"`
	Page      bool      `json:"page"`
	Tags      TagList   `json:"tags"`
	HideInNav bool      `json:"hideinnav"` // Applicable for pages only. If true, it will not be shown in the nav bar
}

Post -

func (*Post) FullURL

func (p *Post) FullURL() string

FullURL -

type PostList

type PostList []Post

PostList -

func (PostList) Len

func (t PostList) Len() int

func (PostList) Less

func (t PostList) Less(i, j int) bool

func (PostList) Swap

func (t PostList) Swap(i, j int)

type PostWithID

type PostWithID struct {
	Post
	ID string `json:"id"`
}

PostWithID -

type PostWithIDList

type PostWithIDList []PostWithID

PostWithIDList -

func (PostWithIDList) Len

func (t PostWithIDList) Len() int

func (PostWithIDList) Less

func (t PostWithIDList) Less(i, j int) bool

func (PostWithIDList) Swap

func (t PostWithIDList) Swap(i, j int)

type Site

type Site struct {
	Title             string          `json:"title"`
	Subtitle          string          `json:"subtitle"`
	Author            string          `json:"author"`
	Favicon           string          `json:"favicon"`
	Description       string          `json:"description"`
	Scheme            string          `json:"scheme"`
	URL               string          `json:"url"`
	HomeURL           string          `json:"homeurl"`
	LoginURL          string          `json:"loginurl"`
	GoogleAnalyticsID string          `json:"googleanalytics"`
	DisqusID          string          `json:"disqus"`
	CactusSiteName    string          `json:"cactus"`
	Created           time.Time       `json:"created"`
	Updated           time.Time       `json:"updated"`
	Content           string          `json:"content"` // Home content.
	Styles            string          `json:"styles"`
	StylesAppend      bool            `json:"stylesappend"`
	StackEdit         bool            `json:"stackedit"`
	Prism             bool            `json:"prism"`
	ISODate           bool            `json:"isodate"`
	Posts             map[string]Post `json:"posts"`

	Footer *string `json:"footer"`
	// contains filtered or unexported fields
}

Site -

func (*Site) FooterMarkdown

func (s *Site) FooterMarkdown() string

FooterMarkdown returns the markdown content of the footer.

func (*Site) PostByID

func (s *Site) PostByID(id string) (Post, bool)

PostByID -

func (*Site) PostBySlug

func (s *Site) PostBySlug(slug string) PostWithID

PostBySlug -

func (*Site) PostsAndPages

func (s *Site) PostsAndPages(onlyPublished bool) PostWithIDList

PostsAndPages -

func (*Site) PublishedPages

func (s *Site) PublishedPages() []Post

PublishedPages -

func (*Site) PublishedPosts

func (s *Site) PublishedPosts() []Post

PublishedPosts -

func (*Site) PublishedPostsWithID

func (s *Site) PublishedPostsWithID() PostWithIDList

PublishedPostsWithID - for RSS, purposely ignore Page

func (*Site) SiteSubtitle

func (s *Site) SiteSubtitle() string

SiteSubtitle -

func (*Site) SiteTitle

func (s *Site) SiteTitle() string

SiteTitle -

func (*Site) SiteURL

func (s *Site) SiteURL() string

SiteURL -

func (*Site) Tags

func (s *Site) Tags(onlyPublished bool) TagList

Tags -

func (*Site) UpdatePost

func (s *Site) UpdatePost(id string, post *Post)

UpdatePost - use nil to delete the post, otherwise add/update it.

type Tag

type Tag struct {
	Name      string    `json:"name"`
	Timestamp time.Time `json:"timestamp"`
}

Tag -

type TagList

type TagList []Tag

TagList -

func (TagList) Len

func (t TagList) Len() int

func (TagList) Less

func (t TagList) Less(i, j int) bool

func (TagList) Split

func (t TagList) Split(s string) TagList

Split -

func (TagList) String

func (t TagList) String() string

String -

func (TagList) Swap

func (t TagList) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳