paivalehti

package
v0.0.0-...-1135a6a Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOrganization = `{{ .Kind }}s/{{ .Posted.Format "2006-01-02" }}`

DefaultOrganization shows where to put files if organization is unset

View Source
const HTML = "html"

HTML signifies a webpage

View Source
const HTMLBegin = "<!--"
View Source
const HTMLSeparator = "-->"
View Source
const Markdown = "markdown"

Markdown signifies markdown

View Source
const MarkdownSeparator = "\n---\n"

MarkdownSeparator separates YAML documents

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Root string

	Title       string
	Subtitle    string
	Description string

	In    string
	Out   string
	Theme string

	Organization map[string]string
}

Config is site configuration

func ConfigFromRoot

func ConfigFromRoot(root string) (Config, error)

ConfigFromRoot returns the sites configuration

type FrontMatter

type FrontMatter struct {
	// Kind is what kind of post this is. See ValidKinds (required)
	Kind string

	// Draft is if the page is a draft (do not publish)
	Draft bool

	// Posted is when was the content posted
	Posted YAMLTime `yaml:`

	// Title is a title of this post. (optional)
	Title string `yaml:",omitempty"`

	// Description is a short description of the post. (optional)
	Description string `yaml:",omitempty"`

	// Source is where the post content originated from
	Source string `yaml:",omitempty"`
}

FrontMatter is what gets stored in the header of an item (or in YAML sidecar)

type Item

type Item struct {
	FrontMatter FrontMatter
	// Content is inline content
	Content string
	// Path is where the input is saved on disk
	Path string
	// RelPath is where the item was found relative to the input directory
	RelPath string
	// Format is the format to store in
	Format string
}

Item is a post to be rendered

type YAMLTime

type YAMLTime struct {
	time.Time
}

func NewYAMLTime

func NewYAMLTime(t time.Time) YAMLTime

func (YAMLTime) MarshalYAML

func (yt YAMLTime) MarshalYAML() (interface{}, error)

func (YAMLTime) UnmarshalYAML

func (yt YAMLTime) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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