Adding open graph info

11 views
Skip to first unread message

Nick Craig-Wood

unread,
Jul 20, 2011, 7:25:56 PM7/20/11
to blogofil...@googlegroups.com
I wanted to add the facebook opengraph meta tags to my site

http://developers.facebook.com/docs/opengraph/

Easy enough I thought, edit site.mako and put it in the head section,
then hey presto it will appear on every page (static and blog)

<head>
[snip]
<meta property="og:title" content="${self.title()}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="What Goes Here?" />
<meta property="og:image" content="xxxx" />
<meta property="og:site_name" content="xxxxx" />
<meta property="fb:admins" content="xxxx" />
</head>

However I can't figure out what to put in the og:url section! This
needs to be the url of the actual page which blogofile certainly knows,
but I don't think it is being put in the context.

I'm using the latest git checkout.

Thanks for any help!

Nick
--
Nick Craig-Wood <ni...@craig-wood.com> -- http://www.craig-wood.com/nick

Ryan McGuire

unread,
Jul 20, 2011, 7:54:18 PM7/20/11
to blogofile-discuss
Try this:

<% from urllib.parse import urljoin %>
Current URL : $
{urljoin(bf.config.site.url,bf.template_context.render_path)}
> Nick Craig-Wood <n...@craig-wood.com> --http://www.craig-wood.com/nick

Nick Craig-Wood

unread,
Jul 21, 2011, 11:00:58 AM7/21/11
to blogofil...@googlegroups.com
On 21/07/11 00:54, Ryan McGuire wrote:
> Try this:
>
> <% from urllib.parse import urljoin %>
> Current URL : $
> {urljoin(bf.config.site.url,bf.template_context.render_path)}

Thanks!

Ah, I think that is only in the plugins branch isn't it? I'm using
master at the moment.

I haven't figured out how to run the plugins branch yet, but I think it
is going to be the future isn't it so I'd better work it out ;-)

A simple way of dupming everything in the bf object would be really useful.

> On Jul 20, 7:25 pm, Nick Craig-Wood <n...@craig-wood.com> wrote:
>> I wanted to add the facebook opengraph meta tags to my site
>>
>> http://developers.facebook.com/docs/opengraph/
>>
>> Easy enough I thought, edit site.mako and put it in the head section,
>> then hey presto it will appear on every page (static and blog)
>>
>> <head>
>> [snip]
>> <meta property="og:title" content="${self.title()}" />
>> <meta property="og:type" content="website" />
>> <meta property="og:url" content="What Goes Here?" />
>> <meta property="og:image" content="xxxx" />
>> <meta property="og:site_name" content="xxxxx" />
>> <meta property="fb:admins" content="xxxx" />
>> </head>
>>
>> However I can't figure out what to put in the og:url section! This
>> needs to be the url of the actual page which blogofile certainly knows,
>> but I don't think it is being put in the context.
>>
>> I'm using the latest git checkout.
>>
>> Thanks for any help!
>>
>> Nick
>> --
>> Nick Craig-Wood <n...@craig-wood.com> --http://www.craig-wood.com/nick
>

Reply all
Reply to author
Forward
0 new messages