在next模版的站点中添加goole AdSense

  1. 注册 Goole AdSense
  2. 复制google Adsense提供的js代码,在Next主题目录下的layout/_custom/head.swig中添加:
    1
    2
    3
    4
    5
    6
    7
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-xxx",
    enable_page_level_ads: true
    });
    </script>
0%