content

package
v0.0.0-...-7f9cc2b Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StaticList = []string{
		"config.toml",
		"public_key.asc",
	}
)

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Posts       []*Post
	Pages       []*Post
	StaticFiles []string
	Tags        mapset.Set[string]
	// contains filtered or unexported fields
}

func NewContentCollection

func NewContentCollection(config *Config, log *log.Logger) (*Collection, error)

func (*Collection) GetPage

func (cc *Collection) GetPage(filename string) (*Post, error)

func (*Collection) GetPost

func (cc *Collection) GetPost(filename string) (*Post, error)

func (*Collection) HandleFile

func (cc *Collection) HandleFile(filename string, d fs.DirEntry) error

type Config

type Config struct {
	Root        string
	PostDir     string
	Repo        *vcs.Repository
	StaticFiles []string
}

type Post

type Post struct {
	Input    string
	Basename string
	URL      string
	Commits  []*vcs.Commit
	*PostMatter
	// contains filtered or unexported fields
}

func (*Post) Render

func (p *Post) Render(w io.Writer) error

func (*Post) RenderString

func (p *Post) RenderString() (string, error)

func (*Post) WriteTo

func (p *Post) WriteTo(w io.Writer) (int64, error)

implements io.WriterTo

type PostMatter

type PostMatter struct {
	Date        time.Time
	Description string
	Title       string
	Taxonomies  struct {
		Tags []string
	}
}

Directories

Path Synopsis
build command

Jump to

Keyboard shortcuts

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