hugoexport

package
v0.7.3-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: GPL-3.0 Imports: 13 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var AreaMaxSize = Size{500, 200}

AreaMaxSize is the size where an area should fit into.

View Source
var ContentArtistSubfolder = filepath.Join("content", "artist")

ContentArtistSubfolder the folder for the md content files.

View Source
var ContentArtworkSubfolder = filepath.Join("content", "artwork")

ContentArtworkSubfolder the folder for the md content files.

View Source
var ImgArtistSubfolder = filepath.Join("static", "img", "artist")

ImgArtistSubfolder is where the images will be exported

View Source
var ImgArtworkSrcFilename = "00000001.jpg"

ImgArtworkSrcFilename is the filename of the picture inside the src (pictures) folder

View Source
var ImgArtworkSubfolder = filepath.Join("static", "img", "artwork")

ImgArtworkSubfolder is where the images will be exported

View Source
var JSONArtistSubfolder = filepath.Join("data", "artist")

JSONArtistSubfolder is where the person json files will be copied

View Source
var JSONArtworkSubfolder = filepath.Join("data", "artwork")

JSONArtworkSubfolder is where the pictures json files will be copied

View Source
var ResizeFilter = imaging.Lanczos

ResizeFilter defines thee resize algorithm

View Source
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 Artists

func Artists(artistRootFolder string, exportRootPath string)

Artists exports all the artists into the Artist content folder

func ContentFromPerson

func ContentFromPerson(p *data.Person, w io.Writer)

ContentFromPerson creates a content page from a person.

func ContentFromPicture

func ContentFromPicture(p *data.Picture, w io.Writer)

ContentFromPicture creates a content page from a picture.

func ExportAreas

func ExportAreas(picPath string, p data.Picture, exportRootPath string)

ExportAreas the defined areas are cut out of the original image.

func ExportArtistContent

func ExportArtistContent(p *data.Person, exportRootPath string)

ExportArtistContent exports the picture data into the content folder

func ExportArtistData

func ExportArtistData(p *data.Person, exportRootPath string)

func ExportArtistProfilePics

func ExportArtistProfilePics(p *data.Person, artistRootFolder, exportRootPath string)

func ExportImage

func ExportImage(picPath string, p data.Picture, exportRootPath string)

ExportImage resizes the image into the ResizeSizes and saves them into the exportRootPath.

func ExportImageContent

func ExportImageContent(p *data.Picture, exportRootPath string)

ExportImageContent exports the picture data into the content folder

func ExportImageData

func ExportImageData(p data.Picture, exportRootPath string)

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.

func WritePage

func WritePage(pfm *PageFrontMatter, content string, w io.Writer)

WritePage writes the page into the io.Writer. First the FrontMatter and then the content.

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

type Size

type Size struct {
	Width  int
	Height int
}

Size describes the size of an image

Jump to

Keyboard shortcuts

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