stick icon indicating copy to clipboard operation
stick copied to clipboard

Unable to use set tag to capture chunks of text

Open thatDAMNbobby opened this issue 3 years ago • 4 comments

I'd like to use this format of the set tag, but it doesn't appear to be implemented (results in a parse error)

{% set foo %}
    <div id="pagination">
        ...
    </div>
{% endset %}

Any plans to implement this in the future?

thatDAMNbobby avatar Feb 24 '21 23:02 thatDAMNbobby

@thatDAMNbobby Good catch! I didn't realize this syntax was possible. I'm definitely interested in implementing this, but may not be able to devote any time to it in the near future.

tyler-sommer avatar Feb 25 '21 00:02 tyler-sommer

I am getting the same error as well

Vizualni avatar Jan 10 '22 01:01 Vizualni

@thatDAMNbobby @thatDAMNbobby @Vizualni do you know that twig is a clone of python django template engine, and that there is already a golang template engine that already support django like template engine? https://www.schlachter.tech/solutions/pongo2-template-engine/ it have more community and looks have more supported currently, since last commit is about 1 month ago. (I'm not work on it I just found it by coincidence.)

Regards.

eriknyk avatar Apr 22 '22 22:04 eriknyk

https://www.schlachter.tech/solutions/pongo2-template-engine/

pongo2 looks great! I've updated the README with a link to that project as I think it's worth calling out as an alternative to stick. Thanks for pointing this out, @eriknyk!

tyler-sommer avatar May 11 '22 23:05 tyler-sommer

Finally had a bit of time to devote to this, and I'm happy to report that this has been fixed in 22492ee95657618e1b467d6e3830cda4d3ae4dd2 and is available in v1.0.6 and later.

Thanks again for the feedback @thatDAMNbobby :)

tyler-sommer avatar Apr 01 '23 06:04 tyler-sommer