Converting the HTML part of the current Facebook button into the Jade Template Langauge?

StackOverflow https://stackoverflow.com/questions/7804923

  •  25-10-2019
  •  | 
  •  

Question

This is the code for the Facebook like button:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=101562769948573";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-href="http://foodjing.com/" data-send="true" data-width="450" data-show-faces="true"></div>

I would like to write that in Jade (because my index is a jade file). Any suggestions to accomplish that?

Was it helpful?

Solution

Look into jade documentation .https://github.com/visionmedia/jade

I would suggest you the following:

div#fb-root
script
(function(d, s, id) {
   var js, fjs = d.getElementsByTagName(s)[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement(s); js.id = id;
   js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=101562769948573";
   fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

div.fb-like(data-href="http://foodjing.com/" data-send="true" data-width="450" data-show-faces="true")

OTHER TIPS

Late reply but you may want to check http://html2jade.org/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top