11/10/2023 0 Comments Pug template mixin![]() Both of the single line & multi line solutions must be outdated, because they did not work for me. The solutions I tried were from this stackoverflow post. When searching, I see nothing discussing this. I also tried it without var as well, just to see what would happen. Here is an example of the generated HTML: Ī solution I tried was using unbuffered code to include the mixin like so: //- header.pugīut when I do this, I get an error saying that setting (the mixin) is not a function. When I try and include the setting mixin so it creates the shortcode for the phone number, it ends up being inserted as a string. The shortcode that the mixin generates, when processed by the third party server, grabs the phone number from their database. Within my header.pug template I am trying to code a default link for the phone number, which I'm inserting within the right-widget block using a three-column header. Have fun All the demos in this article are available in this CodePen collection. You can also leverage some of Pug s awesome features to speed things up, mitigate errors, and randomly generate demos. Within my template I need to use a shortcode from a third-party website to include the phone number (and other settings) dynamically which I've created a simple mixin to generate: //- mixins.pug In 5 minutes you now know enough Pug to be well on your way to speeding up your markup generation. I'm starting to use Pug but I ran into an issue when I tried to use a mixin to generate an attributes value. Tl dr: What's the proper way to insert a mixin within a links href attribute? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |