From 53e01c1778db326cb960cbebb401e1d852cc8807 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Thu, 9 Jan 2020 01:45:01 +0800 Subject: [PATCH] Code optimization. --- _config.yml | 6 ++++++ _includes/search-loader.html | 2 +- assets/data/proxy.json | 4 +++- assets/data/search.json | 1 - assets/img/favicons/browserconfig.xml | 3 ++- assets/img/favicons/manifest.json | 3 ++- sitemap.xml | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/_config.yml b/_config.yml index 7f63d07..37e24b1 100644 --- a/_config.yml +++ b/_config.yml @@ -140,6 +140,12 @@ defaults: - label: Home url: / + - + scope: + path: assets/data + values: + layout: compress + sass: sass_dir: /assets/css diff --git a/_includes/search-loader.html b/_includes/search-loader.html index 80fe245..f78891c 100644 --- a/_includes/search-loader.html +++ b/_includes/search-loader.html @@ -25,7 +25,7 @@ SimpleJekyllSearch({ searchInput: document.getElementById('search-input'), resultsContainer: document.getElementById('search-results'), json: '{{ site.baseurl }}/assets/data/search.json', - searchResultTemplate: '{{ result_elem }}', + searchResultTemplate: '{{ result_elem | strip_newlines }}', noResultsText: '{{ not_found }}' }); \ No newline at end of file diff --git a/assets/data/proxy.json b/assets/data/proxy.json index 897ed13..58c185f 100644 --- a/assets/data/proxy.json +++ b/assets/data/proxy.json @@ -1,4 +1,6 @@ --- --- -{"proxyUrl":"{{ site.google_analytics.proxy_url }}"} \ No newline at end of file +{ + "proxyUrl": "{{ site.google_analytics.proxy_url }}" +} \ No newline at end of file diff --git a/assets/data/search.json b/assets/data/search.json index 6ae087f..08d853d 100644 --- a/assets/data/search.json +++ b/assets/data/search.json @@ -1,5 +1,4 @@ --- -layout: compress --- [ diff --git a/assets/img/favicons/browserconfig.xml b/assets/img/favicons/browserconfig.xml index 15858d0..723f626 100644 --- a/assets/img/favicons/browserconfig.xml +++ b/assets/img/favicons/browserconfig.xml @@ -1,10 +1,11 @@ --- +layout: compress + # A part of the Favicons # v2.0 # https://github.com/cotes2020/jekyll-theme-chirpy # © 2019 Cotes Chung # MIT License -layout: compress --- diff --git a/assets/img/favicons/manifest.json b/assets/img/favicons/manifest.json index 96a7198..bfb3286 100644 --- a/assets/img/favicons/manifest.json +++ b/assets/img/favicons/manifest.json @@ -1,10 +1,11 @@ --- +layout: compress + # A part of the Favicons # v2.0 # https://github.com/cotes2020/jekyll-theme-chirpy # © 2019 Cotes Chung # MIT License -layout: compress --- { diff --git a/sitemap.xml b/sitemap.xml index 28644d0..bc6af4c 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,6 +1,6 @@ --- layout: compress -# + # The Sitemap template # v2.0 # https://github.com/cotes2020/jekyll-theme-chirpy