1
0
Fork 0
mirror of https://git.sr.ht/~adnano/kiln synced 2024-05-14 04:06:06 +02:00
kiln/templates.go
2020-09-30 21:57:59 -04:00

43 lines
1.1 KiB
Go

package main
// Default atom feed template
const atom_xml = `<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ .Title }}</title>
<link href="{{ .URL }}"/>
<link rel="self" href="{{ .URL }}{{ .Path }}"/>
<updated>{{ .Updated.Format "2006-01-02T15:04:05Z07:00" }}</updated>
<id>{{ .URL }}{{ .Path }}</id>
{{- $url := .URL -}}
{{- range .Entries }}
<entry>
<title>{{ .Title }}</title>
<link href="{{ $url }}{{ .Permalink }}"/>
<id>{{ $url }}{{ .Permalink }}</id>
<updated>{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}</updated>
<content src="{{ $url }}{{ .Permalink }}" type="text/gemini"></content>
</entry>
{{ end -}}
</feed>`
// Default directory index template
const index_gmi = `# Index of {{ .Permalink }}
{{ range .Dirs }}=> {{ .Permalink }}
{{ end -}}
{{ range .Pages }}=> {{ .Permalink }}
{{ end -}}`
// Default page template
const page_gmi = `# {{ .Title }}
{{ .Content }}`
// Default template for html output
const output_html = `<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{ .Title }}</title>
{{ .Content }}`