Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Post ¶
type Post struct {
// Frontmatter fields
Title string `yaml:"title"`
Date time.Time `yaml:"date"`
Description string `yaml:"description"`
Tags []string `yaml:"tags"`
Draft bool `yaml:"draft"`
// Generated fields
Slug string // URL-friendly identifier
Content string // Rendered HTML content
HTMLContent template.HTML // HTML content for templates (not escaped)
RawContent string // Original markdown content
SourcePath string // Path to source markdown file
PublishDate time.Time // Formatted publish date
}
Post represents a blog post with metadata and content
func (*Post) FormattedDate ¶
FormattedDate returns the date in a human-readable format
func (*Post) GenerateSlug ¶
func (p *Post) GenerateSlug()
GenerateSlug creates a URL-friendly slug from the title or filename
func (*Post) IsPublished ¶
IsPublished returns true if the post is not a draft
type PostList ¶
type PostList []*Post
PostList is a collection of posts with helper methods
func (PostList) FilterByTag ¶
FilterByTag returns posts that have the specified tag
func (PostList) FilterPublished ¶
FilterPublished returns only published (non-draft) posts
func (PostList) GetAllTags ¶
GetAllTags returns a unique list of all tags across all posts
func (PostList) SortByDate ¶
func (pl PostList) SortByDate()
SortByDate sorts posts by date (newest first)
Click to show internal directories.
Click to hide internal directories.