problem with share in a .pug file

0

I have a problem with the share button on my website with the .pug file I created a script as follows:

script(type='text/javascript').
        //Funciones para compartir en redes sociales
        function share_fb(url, title_share,  width,height){
            var position_x;
            var position_y;
            position_x = (screen.width / 2) - (width / 2);
            position_y = (screen.height / 2) - (height / 2);
            window.open('https://www.facebook.com/sharer.php?u='+url+'&t='+title_share, title_share, "width="+width+",height="+height+",menubar=0,toolbar=0,directories=0,scrollbars=no,resizable=no,left="+position_x+",top="+position_y+"");
            console.log(url, title_share)
        }

and the .pug file is this shows me the sharing window but not the post data I want to share

.col-md-1.text-center
  a(href='javascript:void(0)' title=data.post.title.heading onclick="share_fb('#{data.fb.url}', '#{data.post.social_network}', 650, 450)")
     img(src=template_url+'/images/facebookicon.svg' width="22px" height="22px" title='Compartir en Facebook ' + data.post.title.heading alt='Compartir en Facebook ' + data.post.title.heading)

Someone will know that I am doing wrong in the code, I have tried it with the .jade if it works but with .pug it does not work for me ........

and this is the image that throws at me

    
asked by Mateo Diaz lopez 18.05.2018 в 21:12
source

0 answers