www.byjp.me/tools/shared/types.go
JP Hastings-Spital e7c8e60bcc Facebook import
I kinda screwed with everything else to homogenise all the functions - the FB stuff works, but I've definitely broken some of the other importers.

I can work on fixing them in the future if I need them; otherwise others can look at previous commits!
2024-04-04 17:11:14 +01:00

35 lines
850 B
Go

package shared
import "time"
// Maps where a file in an archive file is to where it should be moved in the blog
type MediaMap map[string]string
// Represents the frontmatter of a post
type FrontMatter struct {
Title string `yaml:"title,omitempty"`
Media []MediaItem `yaml:"media,omitempty"`
Date string
Tags []string `yaml:"tags,omitempty"`
BookmarkOf string `yaml:"bookmarkOf,omitempty"`
References []Reference `yaml:"references,omitempty"`
}
type Reference struct {
URL string `yaml:"url"`
Type string `yaml:"type"`
Name string `yaml:"name"`
Author string `yaml:"author"`
Date time.Time `yaml:"date"`
}
type MediaItem struct {
URL string `yaml:"url"`
Alt string `yaml:"alt,omitempty"`
}
type Post struct {
Path string
PostFile string
FrontMatter FrontMatter
}