plugins

package
v0.0.0-...-1f40810 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonLi

func CommonLi() string

func Digest

func Digest(ctx context.Context, post *models.Posts, limit int)

func Digests

func Digests(content string, id uint64, limit int, fn func(id uint64, content, closeTag string) string) string

func FormatComments

func FormatComments(c *gin.Context, i CommentHtml, comments []models.Comments, maxDepth int) string

func FormatLi

func FormatLi(li string, comments models.Comments, respond RespondFn, currentDepth, maxDepth, page int, isTls, isThreadComments bool, eo, parent string) string

func Gravatar

func Gravatar(email string, isTls bool) (u string)

func InitDigestCache

func InitDigestCache()

func ParseDigestConf

func ParseDigestConf(c DigestConfig) map[string]digest.SpecialSolveConf

func PostExcerpt

func PostExcerpt(post *models.Posts)

func PostsMore

func PostsMore(id uint64, content, closeTag string) string

func RemoveWpBlock

func RemoveWpBlock(s string) string

Types

type CommentHandler

type CommentHandler struct {
	*gin.Context
	// contains filtered or unexported fields
}

type CommentHtml

type CommentHtml interface {
	FormatLi(c context.Context, m models.Comments, depth, maxDepth, page int, isTls, isThreadComments bool, eo, parent string) string
	FloorOrder(i, j models.Comments) bool
}

type CommentPageEle

type CommentPageEle struct {
	PageEle
}

func TwentyFifteenCommentPagination

func TwentyFifteenCommentPagination() CommentPageEle

func (CommentPageEle) Current

func (p CommentPageEle) Current(page, totalPage, totalRow int) string

func (CommentPageEle) Dots

func (p CommentPageEle) Dots() string

func (CommentPageEle) Middle

func (p CommentPageEle) Middle(page int, url string) string

func (CommentPageEle) Next

func (p CommentPageEle) Next(url string) string

func (CommentPageEle) Prev

func (p CommentPageEle) Prev(url string) string

func (CommentPageEle) Urls

func (p CommentPageEle) Urls(u url.URL, page int, isTLS bool) string

type Comments

type Comments struct {
	models.Comments
	Children []*Comments
}

type CommonCommentFormat

type CommonCommentFormat struct {
}

func CommentRender

func CommentRender() CommonCommentFormat

func (CommonCommentFormat) FloorOrder

func (c CommonCommentFormat) FloorOrder(i, j models.Comments) bool

func (CommonCommentFormat) FormatLi

func (c CommonCommentFormat) FormatLi(_ context.Context, m models.Comments, currentDepth, maxDepth, page int, isTls, isThreadComments bool, eo, parent string) string

type DigestConfig

type DigestConfig struct {
	DigestWordCount    int    `yaml:"digestWordCount"`
	DigestAllowTag     string `yaml:"digestAllowTag"`
	DigestRegex        string `yaml:"digestRegex"`
	DigestTagOccupyNum []struct {
		Tag             string `yaml:"tag"`
		Num             int    `yaml:"num"`
		ChuckOvered     bool   `yaml:"chuckOvered"`
		EscapeCharacter []struct {
			Tags        string   `yaml:"tags"`
			Character   []string `yaml:"character"`
			Num         int      `yaml:"num"`
			ChuckOvered bool     `yaml:"chuckOvered"`
		} `yaml:"escapeCharacter"`
	} `yaml:"digestTagOccupyNum"`
	// contains filtered or unexported fields
}

type PageEle

type PageEle struct {
	PrevEle    string
	NextEle    string
	DotsEle    string
	MiddleEle  string
	CurrentEle string
}

func TwentyFifteenPagination

func TwentyFifteenPagination() PageEle

func (PageEle) Current

func (p PageEle) Current(page, totalPage, totalRow int) string

func (PageEle) Dots

func (p PageEle) Dots() string

func (PageEle) Middle

func (p PageEle) Middle(page int, url string) string

func (PageEle) Next

func (p PageEle) Next(url string) string

func (PageEle) Prev

func (p PageEle) Prev(url string) string

func (PageEle) Urls

func (p PageEle) Urls(u url.URL, page int, isTLS bool) string

type PaginationNav

type PaginationNav struct {
	Currents func(page, totalPage, totalRows int) string
	Prevs    func(url string) string
	Nexts    func(url string) string
	Dotss    func() string
	Middles  func(page int, url string) string
	Urlss    func(u url.URL, page int, isTLS bool) string
}

func (PaginationNav) Current

func (p PaginationNav) Current(page, totalPage, totalRows int) string

func (PaginationNav) Dots

func (p PaginationNav) Dots() string

func (PaginationNav) Middle

func (p PaginationNav) Middle(page int, url string) string

func (PaginationNav) Next

func (p PaginationNav) Next(url string) string

func (PaginationNav) Prev

func (p PaginationNav) Prev(url string) string

func (PaginationNav) Urls

func (p PaginationNav) Urls(u url.URL, page int, isTLS bool) string

type RespondFn

type RespondFn func(m models.Comments, depth, maxDepth int, isThreadComments bool) string

func Responds

func Responds(respondTml string) RespondFn

func RespondsFn

func RespondsFn() RespondFn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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