From b81ec9ecdfb933c85dff54d47be1adf0904b9fe3 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 21 Jun 2016 16:39:53 +0100 Subject: [PATCH] updates --- assets/public/css/styles.css | 0 assets/public/js/application.js | 0 binary.go | 48 +++++++++++++++++++++++++++++++++ setup.go | 10 ++++++- 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 assets/public/css/styles.css create mode 100644 assets/public/js/application.js diff --git a/assets/public/css/styles.css b/assets/public/css/styles.css new file mode 100644 index 00000000..e69de29b diff --git a/assets/public/js/application.js b/assets/public/js/application.js new file mode 100644 index 00000000..e69de29b diff --git a/binary.go b/binary.go index b0d139c5..d3b091a6 100644 --- a/binary.go +++ b/binary.go @@ -1,5 +1,7 @@ // Code generated by go-bindata. // sources: +// assets/public/css/styles.css +// assets/public/js/application.js // assets/templates/editor.tmpl // assets/templates/frontmatter.tmpl // DO NOT EDIT! @@ -28,6 +30,42 @@ type asset struct { info os.FileInfo } +// publicCssStylesCss reads file data from disk. It returns an error on failure. +func publicCssStylesCss() (*asset, error) { + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-hugo\\assets\\public\\css\\styles.css" + name := "public/css/styles.css" + bytes, err := bindataRead(path, name) + if err != nil { + return nil, err + } + + fi, err := os.Stat(path) + if err != nil { + err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err) + } + + a := &asset{bytes: bytes, info: fi} + return a, err +} + +// publicJsApplicationJs reads file data from disk. It returns an error on failure. +func publicJsApplicationJs() (*asset, error) { + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-hugo\\assets\\public\\js\\application.js" + name := "public/js/application.js" + bytes, err := bindataRead(path, name) + if err != nil { + return nil, err + } + + fi, err := os.Stat(path) + if err != nil { + err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err) + } + + a := &asset{bytes: bytes, info: fi} + return a, err +} + // templatesEditorTmpl reads file data from disk. It returns an error on failure. func templatesEditorTmpl() (*asset, error) { path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-hugo\\assets\\templates\\editor.tmpl" @@ -116,6 +154,8 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ + "public/css/styles.css": publicCssStylesCss, + "public/js/application.js": publicJsApplicationJs, "templates/editor.tmpl": templatesEditorTmpl, "templates/frontmatter.tmpl": templatesFrontmatterTmpl, } @@ -160,6 +200,14 @@ type bintree struct { Children map[string]*bintree } var _bintree = &bintree{nil, map[string]*bintree{ + "public": &bintree{nil, map[string]*bintree{ + "css": &bintree{nil, map[string]*bintree{ + "styles.css": &bintree{publicCssStylesCss, map[string]*bintree{}}, + }}, + "js": &bintree{nil, map[string]*bintree{ + "application.js": &bintree{publicJsApplicationJs, map[string]*bintree{}}, + }}, + }}, "templates": &bintree{nil, map[string]*bintree{ "editor.tmpl": &bintree{templatesEditorTmpl, map[string]*bintree{}}, "frontmatter.tmpl": &bintree{templatesFrontmatterTmpl, map[string]*bintree{}}, diff --git a/setup.go b/setup.go index 9d320629..e2582458 100644 --- a/setup.go +++ b/setup.go @@ -96,6 +96,14 @@ func ParseHugo(c *caddy.Controller, root string) (*Config, error) { Hugo: installer.GetPath(), } + stlsbytes, err := Asset("public/css/styles.css") + + if err != nil { + return conf, err + } + + conf.Styles = string(stlsbytes) + for c.Next() { args := c.RemainingArgs() @@ -116,7 +124,7 @@ func ParseHugo(c *caddy.Controller, root string) (*Config, error) { if err != nil { return conf, err } - conf.Styles = string(stylesheet) + conf.Styles += string(stylesheet) case "admin": if !c.NextArg() { return nil, c.ArgErr()