seo

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Robots(ctx *gin.Context)
	SiteMapIndex(ctx *gin.Context)
	SiteMapResource(ctx *gin.Context)
	SiteMapXSL(ctx *gin.Context, index bool)
}

Handler defines methods for seo routes to interact with the server.

type SEO

type SEO struct {
	*deps.Deps
	// contains filtered or unexported fields
}

SEO defines the handler for all seo routes, such as sitemaps and robots.txt

func New

func New(d *deps.Deps) *SEO

New

Creates a new seo handler.

func (*SEO) Robots

func (s *SEO) Robots(ctx *gin.Context)

Robots

Obtains the Seo Robots field from the options struct which is set in the settings, and returns the robots.txt file.

Returns a http.StatusNotFound if the options don't allow serving of robots.txt

func (*SEO) SiteMapIndex

func (s *SEO) SiteMapIndex(ctx *gin.Context)

SiteMapIndex obtains the sitemap index file from the sitemap model Obtains the []bytes to send back as data when /sitemap.xml is visited.

Returns a http.StatusNotFound if there was an error obtaining the XML file. or there was no resource items found.

func (*SEO) SiteMapResource

func (s *SEO) SiteMapResource(ctx *gin.Context)

SiteMapResource

Obtains the sitemap pages from the sitemap model by using the resource in the url. Obtains the []bytes to send back as data when /:resource/sitemap.xml is visited.

Returns a http.StatusNotFound if there was an error obtaining the XML file or there was no resource items found.

func (*SEO) SiteMapXSL

func (s *SEO) SiteMapXSL(ctx *gin.Context, index bool)

SiteMapXSL

Serves the XSL files for use with any .xml file that is used to serve the sitemap.

Returns a http.StatusNotFound if there was an error obtaining the XSL.

Jump to

Keyboard shortcuts

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