manifest

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirType

type DirType struct {
	// Dir name of dir
	Dir string `yaml:"dir,omitempty"`
	// Structure is the node content of dir
	Structure []*Node `yaml:"structure,omitempty"`
}

DirType represents a directory node

type FileType

type FileType struct {
	// File is the renaming of the file from source. If Source is empty then File should contain the url
	File string `yaml:"file,omitempty"`
	// Source is the source of file. If empty File must be the url
	Source string `yaml:"source,omitempty"`
	// MultiSource is a file build from multiple sources
	MultiSource []string `yaml:"multiSource,omitempty"`
}

FileType represent a file node

type FilesTreeType

type FilesTreeType struct {
	// FileTree is a tree url of a repo
	FileTree string `yaml:"fileTree,omitempty"`
	// ExcludeFiles files to be excluded
	ExcludeFiles []string `yaml:"excludeFiles,omitempty"`
}

FilesTreeType represents a fileTree node

type ManifType

type ManifType struct {
	// Manifest is the manifest url
	Manifest string `yaml:"manifest,omitempty"`
}

ManifType represents a manifest node

type Node

type Node struct {
	ManifType `yaml:",inline"`

	FileType `yaml:",inline"`

	DirType `yaml:",inline"`

	FilesTreeType `yaml:",inline"`

	// Properties of the node
	SkipValidation bool `yaml:"skipValidation,omitempty"`
	// Frontmatter of the node
	Frontmatter map[string]interface{} `yaml:"frontmatter,omitempty"`
	// Type of node
	Type string `yaml:"type,omitempty"`
	// Path of node
	Path string `yaml:"path,omitempty"`
	// LinkResolution describes how links should be resolved when processing the given node
	LinkResolution map[string]string `yaml:"linkResolution,omitempty"`
	// contains filtered or unexported fields
}

Node represents a generic mnifest node

func ResolveManifest

func ResolveManifest(url string, r registry.Interface, contentFileFormats []string) ([]*Node, error)

ResolveManifest collects files in FileCollector from a given url and resourcehandlers.FileSource

func (*Node) HasContent

func (n *Node) HasContent() bool

HasContent returns true if the node is a document node

func (*Node) HugoPrettyPath

func (n *Node) HugoPrettyPath() string

HugoPrettyPath returns hugo pretty path

func (*Node) Name

func (n *Node) Name() string

Name is the name of the node

func (*Node) NodePath

func (n *Node) NodePath() string

NodePath returns fully qualified name of this node i.e. Node.Path + Node.Name

func (*Node) Parent

func (n *Node) Parent() *Node

Parent is the node parent

func (*Node) String

func (n *Node) String() string

Jump to

Keyboard shortcuts

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