nykya

package
v0.0.0-...-20de804 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "nykya.yaml"

Configuration file name

View Source
const DefaultOrganization = `{{ .Kind }}s/{{ .Date.Format "2006" }}`

DefaultOrganization shows where to put files if organization is unset

View Source
const HTML = "html"

HTML signifies a webpage

View Source
const HTMLBegin = "<!--"

HTMLBegin is what HTML frontmatter uses to begin

View Source
const HTMLSeparator = "-->"

HTMLSeparator is what HTML frontmatter uses to end

View Source
const JPEG = "jpeg"

JPEG are images

View Source
const Markdown = "markdown"

Markdown signifies markdown

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

MarkdownSeparator separates YAML documents

View Source
const Raw = "raw"

RAW are raw files

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Root string

	Title       string
	Subtitle    string
	Description string

	SyncCommand string

	In    string
	Out   string
	Theme string

	IncludeDrafts bool

	Organization map[string]string
}

Config is site configuration

func ConfigFromRoot

func ConfigFromRoot(rootOverride 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

	// Date is when was the content posted
	Date YAMLTime `yaml:"date"`

	// 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"`

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

FrontMatter is metadata about an item saved to disk

type RenderInput

type RenderInput struct {
	FrontMatter FrontMatter

	// Inline is inline content
	Inline string

	// ContentPath is relative path to content (not the sidecar)
	ContentPath string

	// Format is the format of the content
	Format string
}

RenderInput is ephemeral metadata for a post to be rendered

type YAMLTime

type YAMLTime struct {
	time.Time
}

YAMLTime is time serializable to frontmatter

func NewYAMLTime

func NewYAMLTime(t time.Time) YAMLTime

NewYAMLTime returns a populated YAMLTime object

func (*YAMLTime) MarshalYAML

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

MarshalYAML marshals time into RFC 1123

func (*YAMLTime) UnmarshalYAML

func (yt *YAMLTime) UnmarshalYAML(v *yaml.Node) error

UnmarshalYAML unmarshals RFC1123 or Y-M-D timestamps to time.Time

Jump to

Keyboard shortcuts

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