From 7a5b34874353e786224dc96350f9b511ec86a850 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BB=91?= <1395348685z@gmail.com>
Date: Fri, 9 Apr 2021 13:30:06 +0800
Subject: [PATCH] Make CONFIG more overridable & Fix quicklink
- Deprecate quicklink.ignores but not obsolete it
- Rename `load-config.js` in source/js/ to `config.js`
---
_config.yml | 1 +
layout/_layout.njk | 2 +-
layout/_third-party/quicklink.njk | 3 +-
scripts/helpers/engine.js | 4 +-
source/js/config.js | 60 ++++++++++++++++++++++++++++++
source/js/load-config.js | 43 ---------------------
source/js/third-party/quicklink.js | 46 ++++++++++++++---------
7 files changed, 95 insertions(+), 64 deletions(-)
create mode 100644 source/js/config.js
delete mode 100644 source/js/load-config.js
diff --git a/_config.yml b/_config.yml
index 8fa4fd21d..cf87e8be6 100644
--- a/_config.yml
+++ b/_config.yml
@@ -553,6 +553,7 @@ quicklink:
# For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores.
# See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns
+ # This option is deprecated. Use `CONFIG.quicklink.ignores` in your custom scripts instead.
ignores:
diff --git a/layout/_layout.njk b/layout/_layout.njk
index d5df40ec8..b1475a209 100644
--- a/layout/_layout.njk
+++ b/layout/_layout.njk
@@ -4,7 +4,7 @@
{{ partial('_partials/head/head.njk', {}, {cache: theme.cache.enable}) }}
{%- include '_partials/head/head-unique.njk' -%}
{% block title %}{% endblock %}
- {{- next_js('load-config.js') }}
+ {{- next_js('config.js') }}
{{- next_inject('head') }}
{{ partial('_third-party/analytics/index.njk', {}, {cache: theme.cache.enable}) }}