parseStaticDocument attempts to find the specified document and return it as a string
(path string)
| 47 | } |
| 48 | // parseStaticDocument attempts to find the specified document and return it as a string |
| 49 | func parseStaticDocument(path string) (string, error) { |
| 50 | _, err := os.Stat(path) |
| 51 | if !os.IsNotExist(err) { |
| 52 | f, _ := ioutil.ReadFile(path) |
| 53 | return string(f), nil |
| 54 | } |
| 55 | return "", fmt.Errorf("static document does not exist for '%s'", publicDir) |
| 56 | } |
| 57 | // build buildHTMLPages creates the htmldocument given data for orbits manifest and the page's |
| 58 | func buildHTMLPages(data []byte, pages ...PageRender) *htmlDoc { |
| 59 | body := make([]string, 0) |