daybookr

package
v0.0.0-...-1298ecb Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LinkYAMLTextField   = "text"
	LinkYAMLTargetField = "target"
)

Variables

This section is empty.

Functions

func From

func From(start int, s []string) []string

func FromTo

func FromTo(start int, end int, s []string) []string

func Generate

func Generate(inputFolder string, outputFolder string, configPath string) error

func IsSite

func IsSite(data interface{}) bool

func LoadText

func LoadText(filename string) (string, error)

func PostsByYear

func PostsByYear(site Site) []yearPosts

func To

func To(end int, s []string) []string

Types

type Content

type Content struct {
	Site Site
	HTML string
}
type Link struct {
	Text   string
	Target *url.URL
}
func CreateLink(text string, target string) (Link, error)

func CreateLinkFromYAML

func CreateLinkFromYAML(yaml *simpleyaml.Yaml) (Link, error)

type Page

type Page struct {
	Layout     string
	Metadata   *simpleyaml.Yaml
	RawContent string
	Content    string
	Name       string
	Title      string
	Site       *Site
}

func (Page) GetHTMLPreview

func (page Page) GetHTMLPreview(chars int) string

type Post

type Post struct {
	Page
	Tags []string
	Date time.Time
}

type Site

type Site struct {
	Title          string
	Subtitle       string
	Author         string
	Pages          []Page
	Posts          []Post
	Tags           []tag
	FooterLinks    []Link
	Conf           *simpleyaml.Yaml
	GenerationTime time.Time
}

func (Site) PostsTo

func (site Site) PostsTo(count int) []Post

Jump to

Keyboard shortcuts

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