Embedding Facebook in a template

Hi

I was hoping someone can help me. I’m using a Hugo template for a website and I was wondering if there’s any way of embedding a Facebook on it using

i.e.

Thanks :slight_smile:

Need to be a little more specific. :slightly_smiling:

Hi,
I’m trying to embed a facebook iFrame using the facebook developer plugin. I’ve tied quoting the code snippets on here but it doesn’t let me. I was just wondering if anyone’s had any experience doing this?

Hello,

Which template are you using? That way we can advise you which files to possibly edit etc.

I have written a blog post on how to do this. Please have a look and if you have further questions, please ask again.

https://stoned.io/web-development/hugo/Embedding-Facebook-In-A-Hugo-Template/

I’m still working on it to make it better. I’m a new author. :slightly_smiling:

Hope this helps.

Cheers,

Sincerely,

Hash

Hi Hash,

Thanks for the reply and the link to your site. I’m using the [Universal theme] http://themes.gohugo.io/hugo-universal-theme/
I’ve tried pasting the Facebook developer code into the template html (single.html) just before the tag and that seems fine i.e doesnt crash out the page, but I can’t seem to figure out where to put the code for the actual plugin to appear.
I was thinking of using the [params.see_more] section.

Again, thanks for help.

Kind regards

Raoul

The Javascript code goes in the head section of your template, and the actual html code goes in single.html.

Nothing should be going into config.toml or [params]

The head section of my template? is that the single.html?

Code from Step 2 goes here:


https://github.com/devcows/hugo-universal-theme/blob/master/layouts/partials/scripts.html (or perhaps here)
Facebook’s Javascript code goes in the scripts.html or the head.html file. You decide.

The code for step 3 goes here:

Thanks so I can put the Facebook Java code in the …/partials/scripts.html

and the

Step 3 code in the …_default/single.html - should it go anywhere before the tag?

Sounds right. Play around with it and figure it out. See how it works. See where the FB code for step 3 works.

“The Seeing… is the Doing.” - Hash Borgir

Thanks - I will :slightly_smiling: