blog

package
v0.0.0-...-74b123e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Metadata PostMetadata `json:"metadata"`
	Filepath string
}

func LoadFromMarkdown

func LoadFromMarkdown(md string) (Post, error)

func LoadFromMarkdownFile

func LoadFromMarkdownFile(filepath string) (Post, error)

func (*Post) RenderHTML

func (post *Post) RenderHTML() string

type PostDB

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

func ConnectToPostDB

func ConnectToPostDB(filepath string) (*PostDB, error)

func (*PostDB) Close

func (pdb *PostDB) Close()

func (*PostDB) CreateNewPost

func (pdb *PostDB) CreateNewPost(post Post) (*sql.Result, error)

func (*PostDB) DeletePostByID

func (pdb *PostDB) DeletePostByID(id string) error

func (*PostDB) GetAllPosts

func (pdb *PostDB) GetAllPosts() ([]Post, error)

func (*PostDB) GetPostByID

func (pdb *PostDB) GetPostByID(id string) ([]Post, error)

func (*PostDB) GetPostByTitle

func (pdb *PostDB) GetPostByTitle(title string) ([]Post, error)

func (*PostDB) Init

func (pdb *PostDB) Init() error

type PostImage

type PostImage struct {
	*ast.Leaf
	ImageURL string
}

type PostMetadata

type PostMetadata struct {
	Title  string `yaml:"Title"`
	Author string `yaml:"Author"`
	ID     string
}

Jump to

Keyboard shortcuts

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