manifest

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveNodeFromParent added in v0.54.0

func RemoveNodeFromParent(node *Node, parent *Node)

RemoveNodeFromParent removes node from its parent node

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

	// Proccessor determines which node processor to use
	Processor string `yaml:"processor,omitempty"`
	// 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, additionalTransformations ...NodeTransformation) ([]*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) RemoveParent added in v0.54.0

func (n *Node) RemoveParent()

RemoveParent removes parent of node

func (*Node) String

func (n *Node) String() string

type NodeTransformation added in v0.54.0

type NodeTransformation func(node *Node, parent *Node, r registry.Interface) (runTreeChangeProcedure bool, err error)

NodeTransformation is the way plugins can contribute to the node tree processing

Jump to

Keyboard shortcuts

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