{"action":"opened","issue":{"url":"https://api.github.com/repos/piranha/gostatic/issues/31","labels_url":"https://api.github.com/repos/piranha/gostatic/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/piranha/gostatic/issues/31/comments","events_url":"https://api.github.com/repos/piranha/gostatic/issues/31/events","html_url":"https://github.com/piranha/gostatic/issues/31","id":56209821,"number":31,"title":"Support templates folder?","user":{"login":"ottob","id":67104,"avatar_url":"https://avatars.githubusercontent.com/u/67104?v=3","gravatar_id":"","url":"https://api.github.com/users/ottob","html_url":"https://github.com/ottob","followers_url":"https://api.github.com/users/ottob/followers","following_url":"https://api.github.com/users/ottob/following{/other_user}","gists_url":"https://api.github.com/users/ottob/gists{/gist_id}","starred_url":"https://api.github.com/users/ottob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ottob/subscriptions","organizations_url":"https://api.github.com/users/ottob/orgs","repos_url":"https://api.github.com/users/ottob/repos","events_url":"https://api.github.com/users/ottob/events{/privacy}","received_events_url":"https://api.github.com/users/ottob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-02T08:49:49Z","updated_at":"2015-02-02T08:49:49Z","closed_at":null,"body":"I'm creating a lot of templates so the TEMPLATES line of `config` is getting rather long. It would be nice if you could specify a folder `TEMPLATES = templates/` (or something similar) and that all templates of that folder would be parsed.\r\n\r\nSomething like this seems to work:\r\n```\r\n\tcase \"TEMPLATES\":\r\n\t\ttemplates := strings.Split(bits[1], \" \")\r\n\t\tfor _, template := range templates {\r\n\t\t\tif strings.HasSuffix(template, \"/\") {\r\n\t\t\t\tfiles, _ := filepath.Glob(template + \"*.tmpl\")\r\n\t\t\t\tfor _, file := range files {\r\n\t\t\t\t\tcfg.Templates = append(cfg.Templates, filepath.Join(base, file))\r\n\t\t\t\t}\r\n\t\t\t\tcontinue\r\n\t\t\t}\r\n\t\t\tcfg.Templates = append(cfg.Templates, filepath.Join(base, template))\r\n\t\t}\r\n\tcase \"SOURCE\":\r\n```"}}