Newer
Older
package common
import (
"html/template"
)
func MustParseTemplate(content string) *template.Template {
return template.Must(template.Must(template.New("content").Parse(content)).New("container").Parse(TEMPLATE_CONTAINER_STR))
}
const TEMPLATE_CONTAINER_STR = `<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style type="text/css">
body {
padding: 1em;
max-width:50em;
}