meta

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EmbeddedExtension is extension of the embedded
	// template files.
	EmbeddedExtension = ".cms"
)

Variables

This section is empty.

Functions

func Init

Creates a new Namespace and returns a new internal.FuncsNamespace

Types

type Namespace

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

Namespace defines the methods for meta to be used as template functions.

func New

Creates a new meta Namespace

func (*Namespace) Footer

func (ns *Namespace) Footer() template.HTML

Footer

Obtains all of the site and post wide Code Injection Returns formatted HTML template for use after the closing `</body>`.

Example: {{ verbisFoot }}

func (*Namespace) Header

func (ns *Namespace) Header() template.HTML

Header

Header obtains all of the site and post wide Code Injection as well as any meta information from the page.

Example: {{ verbisHead }}

func (*Namespace) MetaTitle

func (ns *Namespace) MetaTitle() string

MetaTitle

metaTitle obtains the meta title from the post, if there is no title set on the post, it will look for the global title, if none, return empty string.

Example: <title>Verbis - {{ metaTitle }}</title>

type TemplateMeta

type TemplateMeta struct {
	Site          domain.Site
	Post          *domain.PostDatum
	Options       domain.Options
	Breadcrumbs   verbis.Breadcrumbs
	FacebookImage string
	TwitterImage  string
	// contains filtered or unexported fields
}

TemplateMeta defines the helper for executing meta templates.

func (*TemplateMeta) GetImage

func (tm *TemplateMeta) GetImage(id int) string

GetImage

Is a helper function for the embedded meta templates. Returns an media item url or an empty string if the media item did not exist.

func (*TemplateMeta) IsHomepage

func (tm *TemplateMeta) IsHomepage() bool

IsHomepage

Determines if the current post is the homepage.

Jump to

Keyboard shortcuts

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