Skip to content

Commit

Permalink
general: gofumpt & gci
Browse files Browse the repository at this point in the history
  • Loading branch information
darccio committed Jan 16, 2024
1 parent edbc808 commit 0631278
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
50 changes: 26 additions & 24 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,29 @@ import (
"golang.org/x/text/language"
)

var ZAS = "zas"
var ZAS_PREFIX = "zs"
var ZAS_NAME = cases.Title(language.English).String(ZAS)
var ZAS_DIR = fmt.Sprintf(".%s", ZAS)
var ZAS_CONF_FILE = filepath.Join(ZAS_DIR, "config.yml")
var ZAS_I18N_FILE = filepath.Join(ZAS_DIR, "i18n.yml")
var ZAS_DIR_CONF_FILE = fmt.Sprintf(".%s.yml", ZAS)
var ZAS_DEFAULT_DIR_PERM = 0755
var ZAS_DEFAULT_FILE_PERM = 0644
var ZAS_DEFAULT_CONF = ConfigSection{
ZAS: ConfigSection{
"layout": filepath.Join(ZAS_DIR, "layout.html"),
"deploy": filepath.Join(ZAS_DIR, "deploy"),
},
"site": ConfigSection{
"baseurl": "http://example.com",
"language": "en",
},
"mimetypes": ConfigSection{
"text/markdown": "markdown",
"text/plain": "plain",
"text/html": "html",
},
}
var (
ZAS = "zas"
ZAS_PREFIX = "zs"
ZAS_NAME = cases.Title(language.English).String(ZAS)
ZAS_DIR = fmt.Sprintf(".%s", ZAS)
ZAS_CONF_FILE = filepath.Join(ZAS_DIR, "config.yml")
ZAS_I18N_FILE = filepath.Join(ZAS_DIR, "i18n.yml")
ZAS_DIR_CONF_FILE = fmt.Sprintf(".%s.yml", ZAS)
ZAS_DEFAULT_DIR_PERM = 0o755
ZAS_DEFAULT_FILE_PERM = 0o644
ZAS_DEFAULT_CONF = ConfigSection{
ZAS: ConfigSection{
"layout": filepath.Join(ZAS_DIR, "layout.html"),
"deploy": filepath.Join(ZAS_DIR, "deploy"),
},
"site": ConfigSection{
"baseurl": "http://example.com",
"language": "en",
},
"mimetypes": ConfigSection{
"text/markdown": "markdown",
"text/plain": "plain",
"text/html": "html",
},
}
)
12 changes: 5 additions & 7 deletions generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ import (
yaml "gopkg.in/yaml.v2"
)

var (
helpers = thtml.FuncMap{
"noescape": noescape,
"eq": eq,
}
)
var helpers = thtml.FuncMap{
"noescape": noescape,
"eq": eq,
}

/*
* Convenience type to group relevant rendering info.
Expand Down Expand Up @@ -466,7 +464,7 @@ func (gen *Generator) extractPageConfig(doc *goquery.Document) (config map[inter
/*
* Copies a file.
*/
func (gen *Generator) copy(dstPath string, srcPath string) (err error) {
func (gen *Generator) copy(dstPath, srcPath string) (err error) {
src, err := os.Open(srcPath)
if err != nil {
return
Expand Down

0 comments on commit 0631278

Please sign in to comment.