From c283e7782fa9562d82d9855fd280a573fd58c75f Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Fri, 31 Mar 2023 06:41:51 +0800 Subject: [PATCH] refactor!: rename assets origin configuration files --- .../self_host.yml => origin/basic.yml} | 0 .../cross_origin.yml => origin/cors.yml} | 0 _includes/head.html | 15 ++++---- _includes/js-selector.html | 38 +++++++++---------- .../{assets-origin.html => origin-type.html} | 9 +++-- _layouts/default.html | 2 +- _layouts/page.html | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) rename _data/{assets/self_host.yml => origin/basic.yml} (100%) rename _data/{assets/cross_origin.yml => origin/cors.yml} (100%) rename _includes/{assets-origin.html => origin-type.html} (52%) diff --git a/_data/assets/self_host.yml b/_data/origin/basic.yml similarity index 100% rename from _data/assets/self_host.yml rename to _data/origin/basic.yml diff --git a/_data/assets/cross_origin.yml b/_data/origin/cors.yml similarity index 100% rename from _data/assets/cross_origin.yml rename to _data/origin/cors.yml diff --git a/_includes/head.html b/_includes/head.html index f767edb..0c85fe1 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -58,15 +58,15 @@ {% include favicons.html %} {% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %} - + {% else %} - {% for cdn in site.data.assets[origin].cdns %} + {% for cdn in site.data.origin[type].cdns %} {% endfor %} - + {% endif %} @@ -90,20 +90,20 @@ {% endif %} - + - + {% if site.toc and page.toc %} - + {% endif %} {% if page.layout == 'page' or page.layout == 'post' %} - + {% endif %} @@ -113,5 +113,4 @@ {% endunless %} {% include metadata-hook.html %} - diff --git a/_includes/js-selector.html b/_includes/js-selector.html index 895ccef..177aaf2 100644 --- a/_includes/js-selector.html +++ b/_includes/js-selector.html @@ -2,11 +2,11 @@ -{% assign urls = site.data.assets[origin].jquery.js +{% assign urls = site.data.origin[type].jquery.js | append: ',' - | append: site.data.assets[origin].bootstrap.js + | append: site.data.origin[type].bootstrap.js | append: ',' - | append: site.data.assets[origin].search.js + | append: site.data.origin[type].search.js %} @@ -14,20 +14,20 @@ {% if page.layout == 'post' %} {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %} - {% assign urls = urls | append: ',' | append: site.data.assets[origin].countup.js %} + {% assign urls = urls | append: ',' | append: site.data.origin[type].countup.js %} {% endif %} {% endif %} {% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %} - {% assign urls = urls | append: ',' | append: site.data.assets[origin].lazysizes.js %} + {% assign urls = urls | append: ',' | append: site.data.origin[type].lazysizes.js %} {% unless page.layout == 'home' %} {% assign urls = urls | append: ',' - | append: site.data.assets[origin]['magnific-popup'].js + | append: site.data.origin[type]['magnific-popup'].js | append: ',' - | append: site.data.assets[origin].clipboard.js + | append: site.data.origin[type].clipboard.js %} {% endunless %} {% endif %} @@ -42,37 +42,37 @@ {% assign urls = urls | append: ',' - | append: site.data.assets[origin].dayjs.js.common + | append: site.data.origin[type].dayjs.js.common | append: ',' - | append: site.data.assets[origin].dayjs.js.locale + | append: site.data.origin[type].dayjs.js.locale | replace: ':LOCALE', locale | append: ',' - | append: site.data.assets[origin].dayjs.js.relativeTime + | append: site.data.origin[type].dayjs.js.relativeTime | append: ',' - | append: site.data.assets[origin].dayjs.js.localizedFormat + | append: site.data.origin[type].dayjs.js.localizedFormat %} {% endif %} {% if page.content contains '