2017-05-21 7 views
0

私はMeteorをクライアント側でのみ使用しており、オープングラフのメタタグを最適化しようとしています。上記の各プロパティのためなど、HEADの内容を検査すると、内容が<meta property="og:title" content="Blah" dochead="1">として存在し、ブラウザでメテオのOGタグが動作しない

Router.route('/', function() { 
    setupOg(); 
    if (isMobile()) { 
    this.render('landing_mobile'); 
    $('body').css("overflow", "visible"); 
    } 
    else { 
    this.render('landing'); 
    $('body').css("overflow", "hidden"); 
    } 
}); 

function setupOg() { 
    var title = { property: "og:title", content: "Blah" }; 
    var type = { property: "og:type", content: "website" }; 
    var url = { property: "og:url", content: "https://blah.io" }; 
    var image = { property: "og:image", content: "http://i63.tinypic.com/2howf4k.png" }; 
    var siteName = { property: "og:site_name", content: "Blah" }; 
    var description = { property: "blah blah blah." }; 

    DocHead.addMeta(title); 
    DocHead.addMeta(type); 
    DocHead.addMeta(url); 
    DocHead.addMeta(image); 
    DocHead.addMeta(siteName); 
    DocHead.addMeta(description); 
} 

:私はkadira:docheadを使用してルータに次のコードを入れています。

しかし、Facebook Sharing Debuggerを見ると、これらの最適化が見つからないようで、Linkedinで共有しようとすると同じことが起こります。どうしてこれなの?

注意、私のmain.htmlは次のようになります。

<head> 
    <link rel="icon" sizes="16x16 32x32" href="/favicon.ico"> 
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0"> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Blah</title> 
</head> 
+0

:[強化spiderableパッケージ](https://github.com/VeliovGroup/jazeee-meteor-spiderable)、[ES6サポート付きの事前レンダリング](https://ostr.io/info/prerendering) –

答えて

1

私が区別できる2つの理由があります:

  1. が流星はFacebookがURLを開いたときOGを分析することを意味し、クライアント側のレンダリングを持っていますタグは表示されませんので、あなたのページが読み込まれるまで待つ必要があることをFacebook botに伝える必要があります。

  2. そのURLのデータがキャッシュされることがあります。

あなたは既に述べたように、いくつかの他のリンクをLIBやサービスを事前レンダリングを使用する必要があり
+0

また、SEOについてreeeeeally気になる場合は、[prerender.io](https://prerender.io/)サービスを利用することができます –

関連する問題