diff options
| author | Shulhan <ms@kilabit.info> | 2020-05-01 13:30:42 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2020-05-01 13:30:42 +0700 |
| commit | 9039448f8a91ee96ecea1c7c78ccaf81f4699e92 (patch) | |
| tree | 376d09cdf6d18573ee334887b6c33a39910c501e /template_index_html.go | |
| parent | f6811267d6c7985d75f4bec491c26521e88ea514 (diff) | |
| download | ciigo-9039448f8a91ee96ecea1c7c78ccaf81f4699e92.tar.xz | |
all: embed the HTML template and the stylesheet
The parameter for template either in Convert or Generate functions or
in CLI now become pure optional, not default to "templates/html.tmpl"
anymore.
This will minimize steps for user to setup or run the library or program.
Diffstat (limited to 'template_index_html.go')
| -rw-r--r-- | template_index_html.go | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/template_index_html.go b/template_index_html.go new file mode 100644 index 0000000..346827c --- /dev/null +++ b/template_index_html.go @@ -0,0 +1,59 @@ +// Copyright 2020, Shulhan <ms@kilabit.info>. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package ciigo + +const templateIndexHTML = `<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="theme-color" content="#375EAB" /> + + <title>{{.Title}}</title> + + <style> + {{.EmbeddedCSS}} + </style> + + {{- range .Styles}} + <link rel="stylesheet" href="{{.}}" /> + {{- end}} + </head> + <body> + <div class="topbar"> + <div class="container"> + <div class="top-heading"> + <a href="/">ciigo</a> + </div> + <div class="menu"> + <form class="item" action="/_internal/search"> + <input type="text" name="q" placeholder="Search" /> + </form> + </div> + </div> + </div> + + <div class="page"> + <div class="container"> + <h1>{{.Title}}</h1> + <div class="meta"> + {{.Author}} + <br /> + {{.Date}} + </div> + {{.Body}} + </div> + <!-- .container --> + </div> + <!-- .page --> + + <div class="footer"> + Copyright 2020, Shulhan <ms@kilabit.info>. All rights reserved. + <br /> + Use of this source code is governed by a BSD-style license that can be + found in the <a href="/LICENSE">LICENSE</a> file. + </div> + </body> +</html>` |
