From 1ae9435cb9ad12b7c46dcabf92ce62748b0d1c77 Mon Sep 17 00:00:00 2001 From: lispking Date: Thu, 14 Sep 2023 16:52:07 +0800 Subject: [PATCH 1/4] + support google adsense --- _config.yml | 3 +++ layout/_layout.njk | 1 + layout/_third-party/adsense/google-adsense.njk | 3 +++ layout/_third-party/adsense/index.njk | 1 + source/js/third-party/adsense/google-adsense.js | 0 5 files changed, 8 insertions(+) create mode 100644 layout/_third-party/adsense/google-adsense.njk create mode 100644 layout/_third-party/adsense/index.njk create mode 100644 source/js/third-party/adsense/google-adsense.js diff --git a/_config.yml b/_config.yml index e7bb2921a..7547a49e8 100644 --- a/_config.yml +++ b/_config.yml @@ -758,6 +758,9 @@ addtoany: - twitter +# Google Adsense +google_adsense: # + # --------------------------------------------------------------- # Statistics and Analytics # See: https://theme-next.js.org/docs/third-party-services/statistics-and-analytics diff --git a/layout/_layout.njk b/layout/_layout.njk index 8a9bd73ae..256cc178e 100644 --- a/layout/_layout.njk +++ b/layout/_layout.njk @@ -4,6 +4,7 @@ {{ partial('_partials/head/head.njk', {}, {cache: theme.cache.enable}) }} {%- include '_partials/head/head-unique.njk' -%} {% block title %}{% endblock %} + {{ partial('_third-party/adsense/index.njk', {}, {cache: theme.cache.enable}) }} {{ partial('_third-party/analytics/index.njk', {}, {cache: theme.cache.enable}) }} {{- next_inject('head') }}