diff --git a/app/lib/cfg/config.go b/app/lib/cfg/config.go index 1625d76..b6dbe43 100644 --- a/app/lib/cfg/config.go +++ b/app/lib/cfg/config.go @@ -19,6 +19,7 @@ type configStruct struct { DisableSendMail bool `yaml:"disableSendMail"` IsProduction bool `yaml:"isProduction"` LoopDelay uint32 `yaml:"loopDelay"` + StaticDir string `yaml:"staticDir"` } `yaml:"application"` Database struct { Host string `yaml:"host"` diff --git a/app/main.go b/app/main.go index 8b318cd..cdcd769 100644 --- a/app/main.go +++ b/app/main.go @@ -91,6 +91,11 @@ func createApp() *iris.Application { app.UseRouter(accessLog.Handler) app.RegisterView(iris.Jet("./app/templates", ".jet").Reload(true)) views.CreateRouter(app) + + if len(cfg.Config.Application.StaticDir) > 0 { + app.HandleDir("/static", iris.Dir(cfg.Config.Application.StaticDir)) + } + return app } diff --git a/app/templates/pages/index.jet b/app/templates/pages/index.jet index 1b0b46d..5f4af85 100644 --- a/app/templates/pages/index.jet +++ b/app/templates/pages/index.jet @@ -4,23 +4,30 @@ {{ block mainContent() }} -
-
-
- - -
-
- - -
+
+
+ +
+ + +
+
+ + +
- - + + + +
+
+ +
+

Bacon ipsum dolor amet leberkas kevin meatball pork loin beef ribs prosciutto, turducken bacon bresaola tri-tip. Strip steak flank shankle, sirloin short ribs shoulder meatball pork chop kevin ribeye jowl ham pork belly diff --git a/config.template.yaml b/config.template.yaml index 8a1e085..e512614 100644 --- a/config.template.yaml +++ b/config.template.yaml @@ -5,6 +5,7 @@ application: debugSQL: true isProduction: false loopDelay: 3000 + staticDir: "./static" database: host: "localhost" diff --git a/static/sample.jpg b/static/sample.jpg new file mode 100644 index 0000000..cc4a932 Binary files /dev/null and b/static/sample.jpg differ