utils

package
v0.0.0-...-ee1519a Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHTML

func CreateHTML(s string) template.HTML

func Download

func Download(url string, dst string) error

func DownloadIfOutdated

func DownloadIfOutdated(url string, dst string, minMtime time.Time) error

func EnsureDir

func EnsureDir(dir string) error

func GetMtime

func GetMtime(filePath string) (time.Time, error)

func GetTimestamp

func GetTimestamp(filePath string) string

func IsHTML

func IsHTML(s string) bool

func IsMarkdown

func IsMarkdown(s string) bool

func MustGetMtime

func MustGetMtime(filePath string) time.Time

func SanitizeName

func SanitizeName(s string) string

Types

type Sitemap

type Sitemap struct {
	Base         string
	MinTimestamp string
	Entries      []*SitemapEntry
}

func CreateSitemap

func CreateSitemap(base string, minTimestamp string) *Sitemap

func (*Sitemap) Add

func (sitemap *Sitemap) Add(url string, timestamp time.Time)

func (Sitemap) Render

func (sitemap Sitemap) Render(fileName string) error

type SitemapEntry

type SitemapEntry struct {
	Url       string
	Timestamp time.Time
}

Jump to

Keyboard shortcuts

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