diff options
| author | Shulhan <m.shulhan@gmail.com> | 2019-09-27 01:00:39 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2019-09-27 01:04:14 +0700 |
| commit | ba1ba5544a723ef0fa839efc20b72d13409d3617 (patch) | |
| tree | b9b2c7ffbfe065a02cf88bacc3d55ebe305d5515 /cmd/ciigo-example | |
| parent | be3227a9398c35c49c367e2a86b35ec37054031f (diff) | |
| download | ciigo-ba1ba5544a723ef0fa839efc20b72d13409d3617.tar.xz | |
all: include the template file in generated Go code
The internal search template require the HTML generator to be initialized
with HTML template that provide when running "go generate". Without
the template, the internal search function will not work.
Diffstat (limited to 'cmd/ciigo-example')
| -rw-r--r-- | cmd/ciigo-example/static.go | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/cmd/ciigo-example/static.go b/cmd/ciigo-example/static.go index 4365f44..aaae288 100644 --- a/cmd/ciigo-example/static.go +++ b/cmd/ciigo-example/static.go @@ -575,6 +575,75 @@ func generate_sub_index_html() *memfs.Node { return node } +func generatetemplates() *memfs.Node { + node := &memfs.Node{ + SysPath: "templates", + Path: "templates", + Name: "templates", + ContentType: "", + ContentEncoding: "", + Mode: 2147484141, + Size: 0, + } + memfs.GeneratedPathNode.Set("templates", node) + return node +} + +func generatetemplates_html_tmpl() *memfs.Node { + node := &memfs.Node{ + SysPath: "templates/html.tmpl", + Path: "templates/html.tmpl", + Name: "html.tmpl", + ContentType: "text/html; charset=utf-8", + ContentEncoding: "gzip", + Mode: 420, + Size: 610, + V: []byte{ + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 140, 84, 77, 111, 219, 56, + 16, 61, 59, 191, 98, 194, 5, 114, 138, 164, 245, 46, 22, 219, 34, 146, + 209, 196, 241, 161, 64, 209, 22, 112, 122, 232, 169, 160, 168, 145, 57, 8, + 69, 42, 228, 200, 169, 32, 248, 191, 23, 250, 176, 163, 164, 1, 154, 147, + 135, 124, 124, 207, 239, 13, 135, 74, 207, 111, 191, 172, 239, 190, 127, 221, + 128, 230, 202, 172, 206, 210, 241, 103, 145, 106, 148, 197, 234, 108, 177, 72, + 43, 100, 9, 154, 185, 142, 240, 161, 161, 125, 38, 214, 206, 50, 90, 142, + 238, 218, 26, 5, 168, 113, 149, 9, 198, 159, 156, 244, 236, 43, 80, 90, + 250, 128, 156, 53, 92, 70, 239, 4, 36, 79, 58, 86, 86, 152, 137, 61, + 225, 99, 237, 60, 207, 216, 143, 84, 176, 206, 10, 220, 147, 194, 104, 88, + 92, 2, 89, 98, 146, 38, 10, 74, 26, 204, 150, 175, 8, 177, 198, 10, + 35, 229, 140, 243, 51, 173, 191, 254, 253, 255, 191, 205, 245, 205, 112, 190, + 39, 48, 177, 193, 85, 215, 197, 119, 125, 113, 56, 164, 201, 184, 211, 99, + 134, 236, 61, 120, 52, 153, 8, 220, 26, 12, 26, 145, 5, 104, 143, 101, + 38, 18, 25, 2, 114, 72, 6, 36, 86, 33, 76, 14, 186, 46, 2, 47, + 237, 14, 33, 222, 14, 164, 195, 225, 79, 82, 93, 23, 31, 14, 51, 58, + 218, 162, 39, 165, 201, 212, 230, 52, 119, 69, 59, 24, 42, 104, 15, 202, + 200, 16, 50, 193, 174, 206, 165, 23, 253, 246, 179, 253, 62, 168, 36, 139, + 19, 244, 146, 19, 245, 154, 100, 119, 19, 186, 72, 229, 49, 143, 88, 41, + 162, 157, 75, 19, 57, 17, 147, 130, 246, 191, 107, 84, 104, 155, 19, 185, + 116, 190, 58, 2, 196, 88, 9, 144, 138, 201, 217, 76, 36, 63, 200, 50, + 122, 43, 77, 18, 80, 122, 165, 143, 156, 69, 74, 182, 110, 24, 184, 173, + 113, 156, 11, 49, 221, 215, 131, 128, 218, 72, 133, 218, 153, 2, 125, 38, + 182, 35, 111, 236, 203, 96, 168, 255, 187, 183, 155, 59, 37, 11, 77, 46, + 86, 219, 38, 127, 37, 218, 169, 154, 138, 23, 77, 174, 229, 14, 223, 208, + 98, 189, 124, 54, 64, 122, 249, 154, 51, 150, 71, 103, 93, 23, 95, 55, + 172, 157, 31, 70, 163, 63, 152, 251, 83, 202, 174, 139, 111, 37, 227, 4, + 205, 114, 118, 93, 124, 227, 138, 118, 4, 102, 9, 206, 163, 8, 226, 147, + 37, 136, 162, 89, 156, 35, 220, 231, 24, 144, 23, 249, 74, 231, 248, 24, + 99, 237, 234, 214, 211, 78, 51, 252, 243, 247, 242, 253, 37, 108, 117, 99, + 180, 180, 112, 97, 248, 170, 10, 31, 238, 201, 200, 156, 56, 38, 91, 186, + 139, 29, 95, 197, 112, 109, 12, 12, 132, 0, 30, 3, 250, 61, 22, 241, + 217, 179, 52, 223, 2, 130, 43, 129, 53, 5, 8, 174, 241, 10, 65, 185, + 2, 129, 2, 236, 220, 30, 189, 197, 2, 242, 22, 36, 220, 108, 111, 163, + 225, 93, 128, 33, 133, 54, 32, 176, 150, 12, 74, 90, 200, 177, 87, 42, + 93, 99, 11, 32, 11, 172, 17, 158, 110, 246, 211, 199, 245, 230, 243, 118, + 35, 86, 83, 209, 223, 48, 148, 100, 48, 158, 245, 32, 77, 198, 247, 147, + 38, 227, 231, 235, 87, 0, 0, 0, 255, 255, 161, 211, 165, 235, 214, 4, + 0, 0, + }, + } + memfs.GeneratedPathNode.Set("templates/html.tmpl", node) + return node +} + func init() { memfs.GeneratedPathNode = memfs.NewPathNode() memfs.GeneratedPathNode.Set("/", generate_()) @@ -586,4 +655,6 @@ func init() { memfs.GeneratedPathNode.Set("/index.html", generate_index_html()) memfs.GeneratedPathNode.Set("/sub", generate_sub()) memfs.GeneratedPathNode.Set("/sub/index.html", generate_sub_index_html()) + memfs.GeneratedPathNode.Set("templates", generatetemplates()) + memfs.GeneratedPathNode.Set("templates/html.tmpl", generatetemplates_html_tmpl()) } |
