diff options
| author | Christine Dodrill <me@christine.website> | 2019-06-03 10:29:52 +0000 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-06-03 10:29:52 +0000 |
| commit | 7ce978fdecebdf623700fd8c5f882846f1a610ea (patch) | |
| tree | 64f70801af93dfe1b5ffebe69b2dd9142e9dc1d5 /cmd | |
| parent | 4756dab75c0eb3a2255dced9058d4ee7b6efc9ee (diff) | |
| download | x-7ce978fdecebdf623700fd8c5f882846f1a610ea.tar.xz x-7ce978fdecebdf623700fd8c5f882846f1a610ea.zip | |
cmd/within.website: index page
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/within.website/bindata.go | 166 | ||||
| -rw-r--r-- | cmd/within.website/main.go | 7 | ||||
| -rw-r--r-- | cmd/within.website/static/gruvbox.css | 2 |
3 files changed, 26 insertions, 149 deletions
diff --git a/cmd/within.website/bindata.go b/cmd/within.website/bindata.go index 1f8958a..2edafac 100644 --- a/cmd/within.website/bindata.go +++ b/cmd/within.website/bindata.go @@ -1,6 +1,3 @@ -// Code generated by go-bindata. DO NOT EDIT. -// sources: -// static/gruvbox.css package main import ( @@ -8,14 +5,10 @@ import ( "compress/gzip" "fmt" "io" - "io/ioutil" - "os" - "path/filepath" "strings" - "time" ) -func bindataRead(data []byte, name string) ([]byte, error) { +func bindata_read(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { return nil, fmt.Errorf("Read %q: %v", name, err) @@ -23,110 +16,35 @@ func bindataRead(data []byte, name string) ([]byte, error) { var buf bytes.Buffer _, err = io.Copy(&buf, gz) - clErr := gz.Close() + gz.Close() if err != nil { return nil, fmt.Errorf("Read %q: %v", name, err) } - if clErr != nil { - return nil, err - } return buf.Bytes(), nil } -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _staticGruvboxCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x91\x4d\x6e\xdb\x30\x10\x85\xf7\x3c\xc5\x00\xde\xb4\x80\x14\x98\x52\xe4\x38\xf4\xa6\xdd\xf5\x1a\xfc\x19\x5a\x44\x48\x51\xa5\x68\xd7\x41\xa1\xbb\x17\xa2\xe4\x44\x62\x93\xd0\x0b\x0b\x43\xce\x7b\x33\xef\x73\xdc\x74\xf0\x97\x00\x68\xdf\xc5\x52\x73\x67\xec\x2b\x83\x9f\xc1\x70\x5b\xc0\x2f\xb4\x57\x8c\x46\xf2\x02\x06\xde\x0d\xe5\x80\xc1\xe8\x13\x01\x70\xfc\x56\xfe\x31\x2a\xb6\x0c\xea\x63\x40\x37\xd5\x7a\xae\x94\xe9\xce\x0c\xaa\xa5\xe0\x78\x38\x9b\x8e\x01\xbf\x44\x7f\x22\x23\x21\xc2\xab\xd7\xe4\x25\xb8\x7c\x39\x07\x7f\xe9\x14\x83\x5d\x75\x9c\x7e\x53\x83\xf4\xd6\x07\x06\xe9\xec\x50\x28\x21\xaa\xd4\xd7\x07\xcc\xda\xca\xe5\xe9\xae\x96\xf5\xb1\x3e\x6c\xec\xe9\xec\x2e\x7c\x50\x18\x18\xec\x93\x04\x2f\x80\x33\x2e\xa3\xb9\xe2\xf4\x75\x35\x83\x89\xa8\x92\xea\x5d\x4a\xd0\x43\x75\x4c\x52\x1f\xf8\x50\x55\xed\x2b\x9a\xa4\x5a\x5a\x40\x5b\x15\xd0\xd6\x05\xb4\x8f\x05\xb4\x4d\x92\x99\xb7\x2d\x85\x8f\xd1\x3b\x06\x0f\x34\xa5\x30\x6d\x6d\xbd\x7c\xf9\x7d\xf1\x71\x59\x22\xcd\x55\x5a\xd4\x91\x01\xed\x6f\x30\x78\x6b\x14\xec\x84\xe2\xf8\x5c\xaf\x73\xdb\x3f\x34\xe8\x80\xee\xfb\xdb\x66\xbf\x75\x79\x24\xe4\x87\x43\x65\x38\x7c\xeb\x03\x6a\x0c\xc3\x3c\x71\x39\xc8\x16\x1d\x32\xb0\xe6\xdc\xc6\xef\xc9\x78\xb2\x5e\xf2\x9f\xcf\x86\x82\x16\x9a\xca\xa7\xd3\xdb\xe5\x86\xc5\x7b\xca\x00\x23\x49\x7f\x77\x26\xb9\xd4\x5b\x62\x77\x7e\xf7\x27\x39\x9f\xa5\xf1\x9d\xd2\x4a\xfc\x0b\x5a\x9b\xe9\x56\xcc\x3e\x9d\x43\x3f\xeb\x46\x3d\x6d\xe4\x3f\x21\x38\x9f\x8f\x39\xae\xba\x33\x9e\xeb\x3d\xfe\xa7\x7a\x68\x1a\xd9\x3c\x9e\x32\xf5\x9c\x6d\x96\x50\x7e\x39\x92\x91\xfc\x0b\x00\x00\xff\xff\x20\x13\x05\xe2\xa8\x03\x00\x00") +var _static_gruvbox_css = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x91\xdf\x6e\xa4\x20\x14\xc6\xef\x79\x8a\x93\xcc\xcd\x6e\xa2\xcd\xa0\x75\x6a\xf1\x66\x5f\x85\xbf\x42\x2a\xe2\x22\xd3\x9d\x66\xe3\xbb\x6f\x44\xed\x28\xdb\x29\x5e\x48\x80\xf3\x7d\xe7\x7c\x3f\x4b\x4d\x0f\x7f\x11\x80\x72\x7d\xc8\x15\xb5\xa6\xfb\x20\x60\x5d\xef\xc6\x81\x72\x99\xdd\xb7\x0d\x02\xb0\xf4\x96\xff\x31\x22\x68\x02\x65\xed\xa5\x9d\xcf\x06\x2a\x84\xe9\x5b\x02\xc5\x7a\x60\xa9\x6f\x4d\x4f\x80\x5e\x83\x6b\xd0\x84\x10\x73\xe2\x23\x7a\x30\xca\xdf\x5a\xef\xae\xbd\x20\x70\x2a\xea\xf9\x9b\x0b\xb8\xeb\x9c\x27\x10\xd7\x49\x32\xc1\x58\x11\xeb\x06\x2f\x93\xb2\x7c\x7d\x7a\x2a\x79\x59\x97\x97\x83\x3d\x5e\xdc\x99\xf3\x42\x7a\x02\xe7\x28\x41\x33\xa0\x84\xf2\x60\xde\xe5\xbc\x7b\x37\xa3\x09\x52\x44\xd5\x4d\x8a\xe1\x4b\x51\x47\xa9\x2f\x7c\xb0\x28\xce\x05\x8e\x52\x1a\x67\xa0\x8b\x0c\x74\x99\x81\x7e\xce\x40\x57\x51\x66\x99\x36\x67\x2e\x04\x67\x09\x3c\xe1\x98\xc2\x3c\x75\xe7\xf8\xdb\xef\xab\x0b\xeb\x10\xb1\xaf\xbc\x93\x2a\x10\xc0\xc3\x0d\x46\xd7\x19\x01\x27\x26\xa8\x7c\x2d\xf7\xb9\x9d\x9f\x2a\x69\x01\x9f\x87\xdb\x61\xbe\xfd\xf1\x84\xd0\x2f\x2b\x85\xa1\xf0\x63\xf0\x52\x49\x3f\x2e\x1d\xe7\x23\xd7\xd2\x4a\x02\x9d\x69\x75\xf8\x19\x8d\x67\xeb\x35\xff\x65\x1d\x28\x28\xa6\x30\x7f\x69\x3e\x2f\x0f\x2c\xee\x29\x03\x4c\x28\xfe\x36\x26\xa9\xd4\x67\x62\x1b\xbf\xed\x49\xca\x67\x2d\xbc\x53\xda\x89\x7f\x43\xeb\xd0\xdd\x8e\xd9\xc3\x3e\xd4\xab\xaa\xc4\xcb\x41\xfe\x01\xc1\x65\x7d\xcd\x71\x57\x9d\xf0\xdc\xcf\xf1\x3f\xd5\x4b\x55\xf1\xea\xb9\x49\xd4\x53\xb6\x49\x42\xe9\xe5\x84\x26\xf4\x2f\x00\x00\xff\xff\x38\x40\x6e\x02\xa0\x03\x00\x00") -func staticGruvboxCssBytes() ([]byte, error) { - return bindataRead( - _staticGruvboxCss, +func static_gruvbox_css() ([]byte, error) { + return bindata_read( + _static_gruvbox_css, "static/gruvbox.css", ) } -func staticGruvboxCss() (*asset, error) { - bytes, err := staticGruvboxCssBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "static/gruvbox.css", size: 936, mode: os.FileMode(420), modTime: time.Unix(1559522447, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil + return f() } return nil, fmt.Errorf("Asset %s not found", name) } -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -137,10 +55,9 @@ func AssetNames() []string { } // _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "static/gruvbox.css": staticGruvboxCss, +var _bindata = map[string]func() ([]byte, error){ + "static/gruvbox.css": static_gruvbox_css, } - // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the @@ -170,66 +87,19 @@ func AssetDir(name string) ([]string, error) { return nil, fmt.Errorf("Asset %s not found", name) } rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) + for name := range node.Children { + rv = append(rv, name) } return rv, nil } -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree +type _bintree_t struct { + Func func() ([]byte, error) + Children map[string]*_bintree_t } -var _bintree = &bintree{nil, map[string]*bintree{ - "static": &bintree{nil, map[string]*bintree{ - "gruvbox.css": &bintree{staticGruvboxCss, map[string]*bintree{}}, +var _bintree = &_bintree_t{nil, map[string]*_bintree_t{ + "static": &_bintree_t{nil, map[string]*_bintree_t{ + "gruvbox.css": &_bintree_t{static_gruvbox_css, map[string]*_bintree_t{ + }}, }}, }} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} - diff --git a/cmd/within.website/main.go b/cmd/within.website/main.go index 910b4f9..834d70a 100644 --- a/cmd/within.website/main.go +++ b/cmd/within.website/main.go @@ -101,6 +101,13 @@ const indexTemplate = `<!DOCTYPE html> <main> <h1><code>within.website</code> Go Packages</h1> + <ul> + <li><a href="https://within.website/confyg">confyg</a> - A generic configuration file parser based on the go modfile parser</li> + <li><a href="https://within.website/derpigo">derpigo</a> - A simple wrapper to the <a href="https://derpibooru.org">Derpibooru</a> API</li> + <li><a href="https://within.website/johaus">johaus</a> - <a href="http://lojban.org">Lojban</a> parsing</li> + <li><a href="https://within.website/ln">ln</a> - Key->value based logging made context-aware and simple</li> + </ul> + <hr /> <footer class="is-text-center"> diff --git a/cmd/within.website/static/gruvbox.css b/cmd/within.website/static/gruvbox.css index 43c1ba0..aa359cd 100644 --- a/cmd/within.website/static/gruvbox.css +++ b/cmd/within.website/static/gruvbox.css @@ -1,5 +1,5 @@ main { - font-family: Arial, Helvetica, sans-serif; + font-family: monospace, monospace; max-width: 38rem; padding: 2rem; margin: auto; |
