{"repo":"abiosoft/mold","free":true,"listed":false,"github":"https://github.com/abiosoft/mold","clone":"git clone https://github.com/abiosoft/mold.git","description":"Higher level use of Go templates for rendering web pages","language":"Go","stars":87,"topics":["go-template","golang","html","template"],"license":"Apache-2.0","category":"saas-starters-boilerplates","readme_excerpt":"Mold Mold builds on Go templates to provide a simple and familiar API for rendering web pages. Features Mold offers the following, making it an ideal choice for Go projects. - Lightweight : uses only the Go standard library with no external dependencies. - Efficient : utilises Go's in-built template parser under the hood. - Capable : supports all capabilities of Go templates. - Familiar : employs the well-known concepts of Layouts, Views and Partials. Getting Started 1. Create a view file Create an HTML file named index.html . 2. Render Create a new instance and render the view in an HTTP handler. Examples Check the examples directory for more. Documentation Go package documentation is available at https://pkg.go.dev/github.com/abiosoft/mold Concepts Layouts Layouts provide the overall structure for your web pages. They define the common elements that are shared across multiple views, such as headers, footers, navigation menus, stylesheets e.t.c. Inside a layout, calling render without an argument inserts the view's content into the layout's body. To render a specific section, pass the section's name as an argument. The default layout can be overridden by creating a custom layout file and specifying it as an option for a new instance. Views Views are templates that generate the content that is inserted into the body of layouts. Typically what you would put in the of an HTML page. The path to the view file is passed to the rendering engine to produce HTML output. Partials Part","default_branch":null,"files":null,"tree":[],"storefront":"/r/abiosoft","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/abiosoft/mold/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}