Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use static files in html templates #18

Closed
Pechenn opened this issue Oct 17, 2016 · 3 comments

Comments

@Pechenn
Copy link

@Pechenn Pechenn commented Oct 17, 2016

Hi, i use Statik for css and js files and wondering if it possible to use compiled html files in templates. Like loginfile, _ := statikFS.Open("/tmpl/login.html")
tHeader, err := tHeader.ParseFiles(loginfile.data)
Thanks.

@ptman

This comment has been minimized.

Copy link

@ptman ptman commented Nov 4, 2016

Couldn't you do something like:

s, err := fs.New()
f, err := s.Open("/tmpl/login.html")
b, err := ioutil.ReadAll(f)
t, err := template.New("login").Parse(string(b))

?

@Pechenn

This comment has been minimized.

Copy link
Author

@Pechenn Pechenn commented Nov 7, 2016

thanks for respond. now i'm using bindata_fs for that.

@jcchavezs

This comment has been minimized.

Copy link
Collaborator

@jcchavezs jcchavezs commented Apr 3, 2019

Closing this issue as it seems @Pechenn sorted this out.

@jcchavezs jcchavezs closed this Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.