Rename template-dir to templates-dir
Plural makes more sense as there are multiple templates.
This commit is contained in:
parent
f088cd9d5f
commit
10f6067580
16
README.md
16
README.md
|
@ -23,24 +23,24 @@ If you want to use a different port:
|
|||
```
|
||||
|
||||
Note: if you're running it outside of development environment, you
|
||||
should pass `--template-dir` and `--static-dir` arguments pointing to
|
||||
should pass `--templates-dir` and `--static-dir` arguments pointing to
|
||||
templates and static directories:
|
||||
|
||||
```sh
|
||||
./gtranslate \
|
||||
--template-dir /usr/share/webapps/gtranslate/templates \
|
||||
--static-dir /usr/share/webapps/gtranslate/static
|
||||
--templates-dir /usr/share/webapps/gtranslate/templates \
|
||||
--static-dir /usr/share/webapps/gtranslate/static
|
||||
```
|
||||
|
||||
Other settings (available with `./gtranslate --help`):
|
||||
|
||||
```
|
||||
Usage of ./gtranslate:
|
||||
-b, --bind string Address to bind the server to, [addr]:port (default ":5000")
|
||||
--proxy string Proxy URL, with no scheme http is assumed
|
||||
--static-dir string Static files directory (default "./static")
|
||||
--template-dir string Templates directory (default "./templates")
|
||||
--user-agent string User-Agent header to use
|
||||
-b, --bind string Address to bind the server to, [addr]:port (default ":5000")
|
||||
--proxy string Proxy URL, with no scheme http is assumed
|
||||
--static-dir string Static files directory (default "./static")
|
||||
--templates-dir string Templates directory (default "./templates")
|
||||
--user-agent string User-Agent header to use
|
||||
```
|
||||
|
||||
# Using Tor
|
||||
|
|
4
main.go
4
main.go
|
@ -34,7 +34,7 @@ type TranslateSettings struct {
|
|||
|
||||
func main() {
|
||||
bind := pflag.StringP("bind", "b", ":5000", "Address to bind the server to, [addr]:port")
|
||||
templateDir := pflag.String("template-dir", "./templates", "Templates directory")
|
||||
templatesDir := pflag.String("templates-dir", "./templates", "Templates directory")
|
||||
staticDir := pflag.String("static-dir", "./static", "Static files directory")
|
||||
proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed")
|
||||
userAgent := pflag.String("user-agent", "", "User-Agent header to use")
|
||||
|
@ -53,7 +53,7 @@ func main() {
|
|||
|
||||
settings := TranslateSettings{proxyUrl, *userAgent}
|
||||
|
||||
tmpl := template.Must(template.ParseGlob(path.Join(*templateDir, "*.html")))
|
||||
tmpl := template.Must(template.ParseGlob(path.Join(*templatesDir, "*.html")))
|
||||
|
||||
r := mux.NewRouter()
|
||||
|
||||
|
|
Loading…
Reference in New Issue