Phong Duong

🔎Search

JS variable as Pug attribute

21-07-2020 | #pug

You can use JS variables directly as a Pug attribute. You only need to put the variable after your attribute

- url = 'https://example.com/'
a(href=url) Another link
/*
<a href="https://example.com/">Another link</a>
*/

I create a video if you prefer learning by watching

https://youtu.be/myv8ktOJuJI

Share: TwitterFacebookLinkedInHacker News