forward

package
v0.0.0-...-d96dd22 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package forward allows to create simple redirections for pages that have moved to a new URL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forward

type Forward struct {
	// contains filtered or unexported fields
}

Forward plugin context.

func New

func New(sourceProps map[string]interface{}) *Forward

New creates a new instance of the Forward plugin.

func (*Forward) AddPathMapping

func (self *Forward) AddPathMapping(sourcePath, targetPath string) *Forward

AddPathMapping adds a single path mapping between an old path and a new path.

func (*Forward) Initialize

func (self *Forward) Initialize(context *goldsmith.Context) error

func (*Forward) Name

func (*Forward) Name() string

func (*Forward) PathMap

func (self *Forward) PathMap(pathMap map[string]string) *Forward

PathMap sets multiple path mappings between old paths and new paths.

func (*Forward) SourceKey

func (self *Forward) SourceKey(key string) *Forward

SourceKey sets the metadata key used to access the old path (default: "PathOld").

func (*Forward) TargetKey

func (self *Forward) TargetKey(key string) *Forward

SourceKey sets the metadata key used to access the new path (default: "PathNew").

Jump to

Keyboard shortcuts

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