Open kashifkhan0771 opened 1 week ago
Does someone want's to pick this up? I am looking forward to include this in next release and the implementation should be easier as the text template implementation is already done and this one should be done similarly
Feature Description
Enhance Go’s html/template library by incorporating a comprehensive set of utility functions. This will enable more expressive and powerful templating, making it easier to handle inline conditionals, loops, and a variety of string, numeric, and date operations within templates. The feature should include a robust suite of built-in functions
Use Case
Dynamic Content Generation: Simplify the creation of dynamic and personalized HTML templates for web applications. With conditional and looping capabilities, content like user dashboards, email templates, or reports can be generated more efficiently. Static Site Generators: Use templating to generate static HTML pages from data sources, with the ability to apply formatting, loops, and conditional rendering. Web Frameworks: For those building custom web frameworks or microservices, the enhanced utilities would streamline template rendering and improve maintainability of HTML templates. HTML Emails: Generate responsive and personalized HTML email templates with conditional logic for customizing content based on user data, such as tailored greetings, product recommendations, or personalized offers. The utility functions simplify email template creation while ensuring all content is safe and well-formatted.
Proposed Solution
Checkout text templates implementation and do similar for html templates. The code should be added under templates package and
html.go
file.Pseudo Code