Documentation ¶
Overview ¶
Package export collects all the data and copies them into the different folders. For the export the hugo structure is expected. The export subfolders are: - content - data
Index ¶
- Variables
- func Artists(artistRootFolder string, exportRootPath string)
- func ContentFromPerson(p *data.Person, w io.Writer)
- func ContentFromPicture(p *data.Picture, w io.Writer)
- func ExportAreas(picPath string, p data.Picture, exportRootPath string)
- func ExportArtistContent(p *data.Person, exportRootPath string)
- func ExportArtistData(p *data.Person, exportRootPath string)
- func ExportArtistProfilePics(p *data.Person, artistRootFolder, exportRootPath string)
- func ExportImage(picPath string, p data.Picture, exportRootPath string)
- func ExportImageContent(p *data.Picture, exportRootPath string)
- func ExportImageData(p data.Picture, exportRootPath string)
- func ImgArtwork(picRootFolder, exportRootPath string)
- func WritePage(pfm *PageFrontMatter, content string, w io.Writer)
- type PageFrontMatter
- type ResizeType
- type Size
Constants ¶
This section is empty.
Variables ¶
var AreaMaxSize = Size{500, 200}
AreaMaxSize is the size where an area should fit into.
var ContentArtistSubfolder = filepath.Join("content", "artist")
ContentArtistSubfolder the folder for the md content files.
var ContentArtworkSubfolder = filepath.Join("content", "artwork")
ContentArtworkSubfolder the folder for the md content files.
var ImgArtistSubfolder = filepath.Join("static", "img", "artist")
ImgArtistSubfolder is where the images will be exported
var ImgArtworkSrcFilename = "00000001.jpg"
ImgArtworkSrcFilename is the filename of the picture inside the src (pictures) folder
var ImgArtworkSubfolder = filepath.Join("static", "img", "artwork")
ImgArtworkSubfolder is where the images will be exported
var JSONArtistSubfolder = filepath.Join("data", "artist")
JSONArtistSubfolder is where the person json files will be copied
var JSONArtworkSubfolder = filepath.Join("data", "artwork")
JSONArtworkSubfolder is where the pictures json files will be copied
var ResizeFilter = imaging.Lanczos
ResizeFilter defines thee resize algorithm
var ResizeSizes = map[string]Size{
"full": {1600, 900},
"big": {700, 600},
"medium": {500, 400},
"small": {300, 300},
"thumb": {100, 100},
"square": {350, 290},
}
ResizeSizes is for the sizes which will be created thumb will be resized with the thumbnail method. So it will be croped to the given size.
Functions ¶
func ContentFromPerson ¶
ContentFromPerson creates a content page from a person.
func ContentFromPicture ¶
ContentFromPicture creates a content page from a picture.
func ExportAreas ¶
ExportAreas the defined areas are cut out of the original image.
func ExportArtistContent ¶
ExportArtistContent exports the picture data into the content folder
func ExportArtistData ¶
func ExportArtistProfilePics ¶
func ExportImage ¶
ExportImage resizes the image into the ResizeSizes and saves them into the exportRootPath.
func ExportImageContent ¶
ExportImageContent exports the picture data into the content folder
func ExportImageData ¶
ExportImageData exports the pic data as JSON into the JSONArtworkSubfolder
func ImgArtwork ¶
func ImgArtwork(picRootFolder, exportRootPath string)
ImgArtwork exports all the images. PicRootFolder describes the source folder, where all the pictrues are edited. exportRootPath is the destination root folder.
Types ¶
type PageFrontMatter ¶
type PageFrontMatter struct { Title string `json:"title"` Description string `json:"description"` Date time.Time `json:"date"` Tags []string `json:"tags"` PublishDate time.Time `json:"publishdate"` Draft bool `json:"draft"` ID string `json:"id"` Artists []string `json:"artists"` ImageFull string `json:"imagefull"` ImageCard string `json:"imagecard"` ImageThumb string `json:"imagethumb"` }
PageFrontMatter defines the front matter of the hugo page.
func NewPageFrontMatterFromPerson ¶
func NewPageFrontMatterFromPerson(p *data.Person) *PageFrontMatter
NewPageFrontMatterFromPerson maps the person structur to the hugo content.
func NewPageFrontMatterFromPicture ¶
func NewPageFrontMatterFromPicture(p *data.Picture) *PageFrontMatter
NewPageFrontMatterFromPicture maps the structure to the Picture type.
type ResizeType ¶
type ResizeType int
ResizeType defines the method for resizing the image
const ( ResizeFit ResizeType = iota ResizeThumbnail )
Types for resizing