menulinks

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Tag feature.Tag = "site-menulinks"

Variables

View Source
var (
	// LandingPageMenuItemFn is a preset MenuItemFn which provides a new-tab
	// link to the root path of the current domain
	//
	// LandingPageMenuItemFn does not require any permissions, however if any
	// are required, simply wrap LandingPageMenuItemFn within an inline func
	// and return the modified the results
	//
	//   .AddItemFuncs(func(printer *message.Printer) (item *menu.Item, permissions feature.Actions) {
	//       item, _ = LandingPageMenuItemFn
	//       item.Icon = "fa-solid fa-dumpster-fire"
	//       permissions = feature.NewAction(subject, verb, details...)
	//       return
	//   }
	LandingPageMenuItemFn = func(printer *message.Printer) (item *menu.Item, permissions feature.Actions) {
		item = &menu.Item{
			Text:   printer.Sprintf("View Website"),
			Title:  printer.Sprintf("open the website landing page in a new tab"),
			Href:   "/",
			Target: "_blank",
			Icon:   "fa-solid fa-arrow-up-right-from-square fa-fw",
		}
		return
	}
)

Functions

This section is empty.

Types

type CFeature

type CFeature struct {
	site.CSiteFeature[MakeFeature]
	// contains filtered or unexported fields
}

func (*CFeature) AddItemFuncs

func (f *CFeature) AddItemFuncs(fns ...MenuItemFn) MakeFeature

func (*CFeature) Init

func (f *CFeature) Init(this interface{})

func (*CFeature) Make

func (f *CFeature) Make() (feat Feature)

func (*CFeature) SiteFeatureMenu

func (f *CFeature) SiteFeatureMenu(r *http.Request) (m menu.Menu)

func (*CFeature) Startup

func (f *CFeature) Startup(ctx *cli.Context) (err error)

type Feature

type Feature interface {
	feature.SiteFeature
}

type MakeFeature

type MakeFeature interface {
	feature.SiteMakeFeature[MakeFeature]

	AddItemFuncs(fns ...MenuItemFn) MakeFeature

	Make() Feature
}

func New

func New() MakeFeature

func NewTagged

func NewTagged(tag feature.Tag) MakeFeature
type MenuItemFn func(printer *message.Printer) (item *menu.Item, permissions feature.Actions)

Jump to

Keyboard shortcuts

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