Documentation
¶
Overview ¶
Package models defines data structures for content parsing
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
ID int `json:"id"`
Count int `json:"count"`
Description string `json:"description"`
Link string `json:"link"`
Name string `json:"name"`
Slug string `json:"slug"`
Parent int `json:"parent"`
}
Category represents a content category
type FlexInt ¶ added in v1.4.5
type FlexInt int
FlexInt is an int that can be unmarshaled from either int or string JSON
func (*FlexInt) UnmarshalJSON ¶ added in v1.4.5
UnmarshalJSON implements custom unmarshaling for FlexInt
type MediaItem ¶
type MediaItem struct {
ID int `json:"id"`
Slug string `json:"slug"`
Title Title `json:"title"`
MediaType string `json:"media_type"`
MimeType string `json:"mime_type"`
SourceURL string `json:"source_url"`
MediaDetails struct {
Width FlexInt `json:"width"`
Height FlexInt `json:"height"`
File string `json:"file"`
} `json:"media_details"`
}
MediaItem represents a media file
type Metadata ¶
type Metadata struct {
Categories []Category `json:"categories"`
ExportedAt string `json:"exported_at"`
Media []MediaItem `json:"media"`
Users []Author `json:"users"`
}
Metadata represents the full metadata.json structure
type Page ¶
type Page struct {
ID int `yaml:"id"`
Title string `yaml:"title"`
Slug string `yaml:"slug"`
Date time.Time `yaml:"date"`
Modified time.Time `yaml:"modified"`
Status string `yaml:"status"`
Type string `yaml:"type"`
Link string `yaml:"link"`
Author int `yaml:"author"`
Categories []int `yaml:"categories,omitempty"`
Excerpt string `yaml:"-"`
Content string `yaml:"-"`
URLFormat string `yaml:"-"` // URL format: "date" or "slug" (set by generator)
}
Page represents a page or post content with frontmatter metadata
func (Page) GetCanonical ¶
GetCanonical returns the full canonical URL for this page/post
func (Page) GetOutputPath ¶
GetOutputPath returns the filesystem path for this page/post Link field from frontmatter ALWAYS takes priority
func (Page) GetURL ¶
GetURL returns the URL path for this page/post Link field from frontmatter ALWAYS takes priority Posts without Link: use URLFormat ("date" or "slug") Pages without Link: use slug
func (Page) HasValidCategories ¶
HasValidCategories returns true if post has categories other than "Bez kategorii" (ID 1)