util

package
v0.0.0-...-d2b24df Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string = "(development version)"

to set this, use `go build -ldflags "-X util.Version=$(git describe --always --tags --dirty)"`

Functions

func LogRequest

func LogRequest(r *http.Request)

func ProcessHTMLTemplate

func ProcessHTMLTemplate(w http.ResponseWriter, templatePath string, data interface{}) error

func ProcessTextTemplate

func ProcessTextTemplate(w http.ResponseWriter, templatePath string, data interface{}) error

func RefuseUnsupportedMethods

func RefuseUnsupportedMethods(w http.ResponseWriter, r *http.Request) error

Types

type FrontMatter

type FrontMatter struct {
	Title string `yaml:"title"`
	Date  string `yaml:"date"`
}

func ParseFrontmatter

func ParseFrontmatter(path string) (error, *FrontMatter)

func RenderMarkdown

func RenderMarkdown(path string) (error, []byte, *FrontMatter)

type PageData

type PageData struct {
	Posts   []PostRoute
	Version string
	Title   string
	Date    string
	Body    htemplate.HTML
}

type PostRoute

type PostRoute struct {
	Route  string
	Matter FrontMatter
}

Jump to

Keyboard shortcuts

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