package main import "text/template" // Default templates const atom_xml = ` {{ .Title }} {{ .Updated }} {{ .SiteURL }}{{ .Path }} {{ $siteURL := .SiteURL }} {{ range .Entries }} {{ .Title }} {{ $siteURL }}{{ .Permalink }} {{ .Date.Format "2006-01-02T15:04:05Z07:00" }} {{ end }} ` const index_gmi = `# Index of {{ .Permalink }} {{ range .Directories }}=> {{ .Permalink }} {{ end }} {{ range .Pages }}=> {{ .Permalink }} {{ end }}` const page_gmi = `# {{ .Title }} {{ .Content }}` var ( atomTmpl = template.Must(template.New("atom.xml").Parse(atom_xml)) indexTmpl = template.Must(template.New("index.gmi").Parse(index_gmi)) pageTmpl = template.Must(template.New("page.gmi").Parse(page_gmi)) )