blog

package
v0.0.0-...-58ba76c Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetBucket = "assets"
	PageBucket  = "pages"
)

Variables

This section is empty.

Functions

func ArticleToHtml

func ArticleToHtml(a Article) string

func TextNodeToHtml

func TextNodeToHtml(t TextNode) string

Types

type Article

type Article struct {
	Title     string
	Path      string
	Children  []TextNode
	CreatedAt time.Time
	UpdatedAt time.Time
	Draft     bool
}

func ArticlesFromOrgFile

func ArticlesFromOrgFile(r io.Reader) ([]Article, error)

func (*Article) CreatedAtString

func (a *Article) CreatedAtString() string

func (*Article) Introduction

func (a *Article) Introduction() string

func (*Article) LastUpdate

func (a *Article) LastUpdate() time.Time

func (*Article) UrlEncodedTitle

func (a *Article) UrlEncodedTitle() string

type BlockQuote

type BlockQuote struct {
	Content string
}

func (*BlockQuote) GetChildren

func (cb *BlockQuote) GetChildren() []TextNode

func (*BlockQuote) GetContent

func (cb *BlockQuote) GetContent() string

type CodeBlock

type CodeBlock struct {
	Language string
	Content  string
}

func NewCodeBlock

func NewCodeBlock(language string) *CodeBlock

func (*CodeBlock) GetChildren

func (cb *CodeBlock) GetChildren() []TextNode

func (*CodeBlock) GetContent

func (cb *CodeBlock) GetContent() string

type CommentBlock

type CommentBlock struct {
	Content string
}

func NewCommentBlock

func NewCommentBlock() *CommentBlock

func (*CommentBlock) GetChildren

func (cb *CommentBlock) GetChildren() []TextNode

func (*CommentBlock) GetContent

func (cb *CommentBlock) GetContent() string

type Headline

type Headline struct {
	Content  string
	Children []TextNode
	Level    uint
}

func NewHeadline

func NewHeadline(Content string) (*Headline, error)

func (*Headline) GetChildren

func (h *Headline) GetChildren() []TextNode

func (*Headline) GetContent

func (h *Headline) GetContent() string

type OrderedList

type OrderedList struct {
	Children []TextNode
}

func NewOrderedList

func NewOrderedList() *OrderedList

func (*OrderedList) GetChildren

func (ul *OrderedList) GetChildren() []TextNode

func (*OrderedList) GetContent

func (ul *OrderedList) GetContent() string

type Paragraph

type Paragraph struct {
	Content string
}

func NewParagraph

func NewParagraph(Content string) *Paragraph

func (*Paragraph) GetChildren

func (h *Paragraph) GetChildren() []TextNode

func (*Paragraph) GetContent

func (h *Paragraph) GetContent() string

type Properties

type Properties struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	URL       string
}

func (*Properties) GetChildren

func (p *Properties) GetChildren() []TextNode

func (*Properties) GetContent

func (p *Properties) GetContent() string

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(db *bbolt.DB, gitHost string, host string, sitmapController *web.SitemapController) (*Service, error)

func (*Service) AtomFeed

func (s *Service) AtomFeed() (atom.Feed, error)

func (*Service) CheckoutRepository

func (s *Service) CheckoutRepository(destination string) error

func (*Service) CopyAssets

func (s *Service) CopyAssets(assetDir string) error

func (*Service) Fetch

func (s *Service) Fetch(key string) (Article, error)

func (*Service) FetchAll

func (s *Service) FetchAll(includeDraft bool) ([]Article, error)

func (*Service) HomePage

func (s *Service) HomePage() string
func (s *Service) Permalink(a Article) (string, error)

func (*Service) UpdateArticles

func (s *Service) UpdateArticles(orgFile string) error

type TextNode

type TextNode interface {
	GetContent() string
	GetChildren() []TextNode
}

type UnorderedList

type UnorderedList struct {
	Children []TextNode
}

func NewUnorderedList

func NewUnorderedList() *UnorderedList

func (*UnorderedList) GetChildren

func (ul *UnorderedList) GetChildren() []TextNode

func (*UnorderedList) GetContent

func (ul *UnorderedList) GetContent() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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