-
Notifications
You must be signed in to change notification settings - Fork 25
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
Make AssetsPath available in external_template context #46
Comments
Hello, thank you for the report. Could you please explain this use case more detailed? IIRC, I haven't exported this variable for external template on purpose. I assume, if you use external_template (and you write this template) you can hardcode necessary assets path in this template. |
First, I've been looking for a simple tool like My use case started with wanting to hack on the default template ( But then I quickly realized that the default contexts are completely different. The external template's default context is just the I find all of that an annoying learning curve and a barrier to entry for newcomers (like me). I don't see the harm in exporting Potential FixA potential backward-compatible fix could be something like: type TmplCtx struct {
AssetsPath string
Report dmarc.Report
// Deprecate these properties
XMLName xml.Name
ReportMetadata dmarc.ReportMetadata
PolicyPublished dmarc.PolicyPublished
Records []dmarc.Record
MessagesStats dmarc.MessagesStats
} |
Thank you for explanation. I understand your use case and it's completely valid. I agree that it would be better for new users to have consistent variables across all kind of templates (didn't think about it when I implemented external template). |
Update the template context for the external_template so that it has the same context as the built-in templates. Fixes tierpod#46
When building a custom template using the
external_template
format, the.AssetsPath
value is not available to the template engine context.The text was updated successfully, but these errors were encountered: