How to create a template system (e.g. Tumblr's) in Rails?

I looked at Liquid and the like, but I cannot find a way to create a โ€œsingle fileโ€ template that can handle all situations. I do not want to reinvent the wheel, but I will if I do not find an existing solution.

The template system looks like this:

{block:Text}
    <li class="post text">
        {block:Title}
            <h3><a href="{Permalink}">{Title}</a></h3>
        {/block:Title}

        {Body}
    </li>
{/block:Text}
+3
source share
1 answer

The answer I found is Mustache , which allows me to fairly accurately reflect Tumblr templates. Long away.

+4
source

Source: https://habr.com/ru/post/1763693/


All Articles