I suggest the addition of advanced math functions to the Hugo framework. These functions would be accessible in templates, enabling users to perform complex mathematical operations more easily. The proposed functions from https://pkg.go.dev/math to be added are:
Hugo currently supports basic arithmetic operations in templates, but lacks support for more advanced mathematical operations. By adding these functions, we can enhance Hugo's capabilities and make it more versatile for users working with complex math in their projects.
A possible use case could involve a Hugo template displays an interactive map using map tiles from an API like OpenStreetMap or Mapbox. By pulling map tiles at deploy time, we could avoid calls to external APIs by the clients. To identify the map tiles that are needed for a certain geographic area, trigonometric calculations are needed. These calculations are fairly simple but involve the above-mentioned functions.
This proposal introduces new template functions and does not modify existing functionality. As such, it is fully backwards compatible and will not impact existing projects or require any changes to existing templates.
I suggest the addition of advanced math functions to the Hugo framework. These functions would be accessible in templates, enabling users to perform complex mathematical operations more easily. The proposed functions from https://pkg.go.dev/math to be added are:
Hugo currently supports basic arithmetic operations in templates, but lacks support for more advanced mathematical operations. By adding these functions, we can enhance Hugo's capabilities and make it more versatile for users working with complex math in their projects.
A possible use case could involve a Hugo template displays an interactive map using map tiles from an API like OpenStreetMap or Mapbox. By pulling map tiles at deploy time, we could avoid calls to external APIs by the clients. To identify the map tiles that are needed for a certain geographic area, trigonometric calculations are needed. These calculations are fairly simple but involve the above-mentioned functions.
This proposal introduces new template functions and does not modify existing functionality. As such, it is fully backwards compatible and will not impact existing projects or require any changes to existing templates.
Discussed on Discourse here: https://discourse.gohugo.io/t/more-advanced-math-functions/43539/1