From bec924ed4c69f9cbe4b3a46fe6f333be728fac10 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 25 Nov 2019 20:56:50 +0800 Subject: [PATCH] Optimize performance. --- _config.yml | 6 ++-- _includes/head.html | 33 +++++++++++++----- _layouts/default.html | 11 +++--- _layouts/page.html | 29 ++++++++-------- _layouts/post.html | 81 +++++++++++++++++++++++-------------------- assets/css/main.scss | 31 ++++++++++------- assets/css/post.scss | 31 +++++++++++++++++ 7 files changed, 142 insertions(+), 80 deletions(-) diff --git a/_config.yml b/_config.yml index 02d872e..59b7dce 100644 --- a/_config.yml +++ b/_config.yml @@ -42,11 +42,13 @@ google_site_verification: google_meta_tag_verification # change to your verifica timezone: Asia/Shanghai google_analytics: - # Change to your Google Analytics ID - id: 'UA-*********-*' + # Fill with your Google Analytics ID + id: '' # The Google Analytics pageviews switch. # DO NOT enable it unless you know how to deploy the Google Analytics superProxy. pv: false + # superProxy Url, only valid when `google_analytics.pv` is set to 'true' + proxy_url: '' disqus: shortname: 'disqus' # Change to your Disqus shortname. diff --git a/_includes/head.html b/_includes/head.html index dc80e12..984de23 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -19,6 +19,27 @@ {% include favicons.html %} + + + + + + {% if jekyll.environment == 'production' %} + + + + + + + {% if site.google_analytics.proxy_url and site.google_analytics.pv %} + + + {% endif %} + {% endif %} + + + + @@ -55,25 +76,21 @@ integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"> + integrity="sha256-fTuUgtT7O2rqoImwjrhDgbXTKUwyxxujIMRIK7TbuNU=" crossorigin="anonymous" async> + integrity="sha256-5+02zu5UULQkO7w1GIr6vftCgMfFdZcAHeDtFnKZsBs=" crossorigin="anonymous" async> - {% if jekyll.environment == 'production' %} - {% include google-analytics.html %} - {% endif %} - {% if page.layout == 'home' or page.layout == 'post' %} - + {% if site.google_analytics.pv %} diff --git a/_layouts/default.html b/_layouts/default.html index 1cf913e..e59504a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -17,7 +17,6 @@ layout: compress