Facebook Open Graph Single Page Apps

前端 未结 1 617
醉酒成梦
醉酒成梦 2021-01-06 19:09

I have built a single page application using backbone js. I have separate backbone url \"routes\" for various application states and dynamic content (e.g. books), but essent

1条回答
  •  囚心锁ツ
    2021-01-06 20:02

    You can have the server output dynamic content for this, but you still need a different url for each object since this is how facebook index those objects.

    What you can do however, is use the querystring or fragment parts of the url to identify it. So, let's say you have a single page that you want to serve all the open graph objects: your-domain.com/og now you can add to it identifiers like this:

    your-domain.com/og?type=3&id=432543643
    your-domain.com/og#type=653&id=46t43g3
    your-domain.com/og?type=25id=4tn4g43#anotherstring
    

    0 讨论(0)
提交回复
热议问题