Google+ share url: what parameters does it use?

后端 未结 4 1359
醉酒成梦
醉酒成梦 2020-12-08 10:26

I want to make like on Stackoverflow. I do not whant +1 button (it takes some time for loading and all page loading are little slower). I\'ve looked on source p

4条回答
  •  佛祖请我去吃肉
    2020-12-08 10:49

    The share link supports two url paramaters: url, for the target url, and hl, for a language code.

    The structured markup on the target url determines the title, description and image shared on Google+. For example, if you add schema.org markup or OpenGraph tags to the page that you're sharing it appears to pick it up just like it does for the +1 button.

    In the official docs for the +Snippet it indicates that schema.org markup is preferred. So if you add markup to your page that looks something like this:

    
      

    Shiny Trinket

    Shiny trinkets are shiny.

    you will see your title read from the name field and image from the aptly named image field.

    Alternatively, you can add OpenGraph tags to the head of your page to specify the same fields like this:

    
    
    
    

提交回复
热议问题