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

Ability to load template from embed.FS #329

Closed
yusufmalikul opened this issue Nov 18, 2021 · 1 comment
Closed

Ability to load template from embed.FS #329

yusufmalikul opened this issue Nov 18, 2021 · 1 comment

Comments

@yusufmalikul
Copy link

I have a Go app that embeds all HTML templates. Using authboss I need to provide login page template like this:
ab.Config.Core.ViewRenderer = abrenderer.NewHTML("/auth", "/views")

Then I store the login template login.tpl inside /views/html-templates/login.tpl to override the built-in template. The login page shows the correct template if I run it inside the project directory. It didn't work if I run it outside the project directory because it read the system file and can't find the embedded login template using Go embed embed.FS.

Is it possible that ab.Config.Core.ViewRenderer supports template files from embed.FS?

Thank you.

@yusufmalikul
Copy link
Author

I will close this because it is related to the authboss-renderer: https://github.com/volatiletech/authboss-renderer.
I created a PR on that repo instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant