package main import "text/template" // Default templates const atom_xml = ` {{ .Title }} {{ .Updated.Format "2006-01-02T15:04:05Z07:00" }} {{ .URL }}{{ .Path }} {{- $url := .URL -}} {{- range .Entries }} {{ .Title }} {{ $url }}{{ .Permalink }} {{ .Date.Format "2006-01-02T15:04:05Z07:00" }} {{ end -}} ` const index_gmi = `# Index of {{ .Permalink }} {{ range .Dirs }}=> {{ .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)) )