This site is built with Viewi itself. It is experimental and still in development. If you see any bugs please do not hesitate and open an issue or DM me on Twitter.

On Build Rendering

Sometimes it’s useful to prerender some content by running some calculations first, for example you want to highlight the syntax of the code from some file. And you don’t want to do that every time you render the component. For that purpose there is "on build render" syntax:

<div class="code php-code">
    <pre>{# highlight(file_get_contents('path/to/your/file')) #}</pre>
</div>

Everything that is inside of {# #} will be executed during the build and inserted as a raw html onto your component’s template. Consider it as a cache, calculate it once, and render every time as a raw content.