{"repo":"kataras/blocks","free":true,"listed":false,"github":"https://github.com/kataras/blocks","clone":"git clone https://github.com/kataras/blocks.git","description":"Go-idiomatic View Engine","language":"Go","stars":77,"topics":["go","views","template","iris"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Blocks Blocks is a, simple, Go-idiomatic view engine based on html/template, plus the following features: - Compatible with the fs.FS, embed.FS and http.FileSystem interface - Embedded templates through embed.FS or go-bindata - Load with optional context for cancelation - Reload templates on development stage - Full Layouts and Blocks support - Automatic HTML comments removal - Memory File System - Markdown Content - Global FuncMap Installation The only requirement is the Go Programming Language. Getting Started Extensive and thorough documentation making it easy to get started with Blocks. Create a folder named ./views and put some HTML template files. Now, open the ./views/layouts/main.html file and paste the following: The template \"content\" . is a Blocks builtin template function which renders the main content of your page that should be rendered under this layout. The block name should always be \"content\" . The partial is a Blocks builtin template function which renders a template inside other template. The . (dot) passes the template's root binding data to the included templates. Continue by creating the ./views/index.html file, copy-paste the following markup: In order to render index on the main layout, create the ./main.go file by following the below. Import the package: The blocks package is fully compatible with the standard library. Use the New(directory string) function to return a fresh Blcoks view engine that renders templates. This directory can be used to loc","default_branch":null,"files":null,"tree":[],"storefront":"/r/kataras","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kataras/blocks/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."}