Include app js script to the template header

pull/1/head
Nikita Tokarchuk 3 years ago
parent f182988346
commit a7f780e5be
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 3
      frontend/templates/funcs.go
  2. 2
      frontend/templates/head.go.tmpl
  3. 1
      frontend/templates/urls.go

@ -10,6 +10,9 @@ func UseFuncs() template.FuncMap {
"sub": func(i int) int { "sub": func(i int) int {
return i - 1 return i - 1
}, },
"getJSAppURL": func() string {
return URLJSApp
},
"getIndexURL": func() string { "getIndexURL": func() string {
return URLIndex return URLIndex
}, },

@ -4,4 +4,6 @@
<meta name="description" content="{{ .Description }}"/> <meta name="description" content="{{ .Description }}"/>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<script type="text/javascript" src="{{ getJSAppURL }}" async></script>
</head> </head>

@ -5,4 +5,5 @@ const (
URLIndex = "/index.aspx" URLIndex = "/index.aspx"
URLBlog = "/blog.aspx" URLBlog = "/blog.aspx"
URLPost = "/post.aspx" URLPost = "/post.aspx"
URLJSApp = "/js-bin/app.js"
) )

Loading…
Cancel
Save