page

package
v0.0.0-...-17e3bd2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FILENAME_ORDER     = []string{"md", "html", "txt"}
	ErrPageOutsideRoot = errors.New("page is outside of document root")
	ErrPageNotFound    = errors.New("page not found")
)

Functions

This section is empty.

Types

type HTMLPage

type HTMLPage struct {
	Site state.ConfigWiki // Site settings
	Page pageValues
}

HTML Template struct

type Page

type Page struct {
	DocumentRoot string // Document root
	Path         string // path to the page, including full file name
	IndexPage    string // The name of the default page to see when going to a namespace
	Namespace    string // Page Namespace
	FileName     string // Page file name (without the format)
	ContentType  string // Page Content type
	Content      []byte // Page contents
}

Page struct

func (*Page) ReadPage

func (p *Page) ReadPage() error

Opens a page and returns the contents as a string, or an error if there is one This will follow all pathing and filename lookup orders

func (*Page) RenderPage

func (p *Page) RenderPage(w http.ResponseWriter, httpCode int) error

Render a page

Jump to

Keyboard shortcuts

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