content

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentFile

type ContentFile struct {
	// The built (i.e. HTML) content.
	Content string `yaml:"Content"`
	// The contents of the yaml header.
	Metadata ContentMetadata `yaml:"Metadata"`
	// The path to the built content file relative to the output directory.
	Path string `yaml:"Path"`
	// The markdown content of the file from below the yaml header.
	RawContent string `yaml:"RawContent"`
	// The path to the file the Content struct was built from.
	SourcePath string `yaml:"SourcePath"`
}

Represents a markdown file with a YAML header containing metadata about that file.

func ReadFile

func ReadFile(filePath string) (*ContentFile, error)

func (ContentFile) Validate

func (contentFile ContentFile) Validate() error

type ContentMetadata

type ContentMetadata struct {
	LastModified time.Time `yaml:"LastModified,omitempty"`
	Published    time.Time `yaml:"Published,omitempty"`
	TemplateName string    `yaml:"TemplateName,omitempty"`
	Title        string    `yaml:"Title,omitempty"`
}

Jump to

Keyboard shortcuts

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