diff --git a/_config.yml b/_config.yml index 888e83939327b53f045b4526c24bc632974b43b5..ecef5b057e90b8a50c390025434178652b7cb5af 100644 --- a/_config.yml +++ b/_config.yml @@ -801,6 +801,16 @@ tag_cloud: # Maximum number of tags displayed. Change it if you have more than 200 tags. max_amount: 200 +# Eliminate the old version of IE browser (IE6~11). +# See: https://support.dmeng.net/upgrade-your-browser.html +kill_old_ie: + enable: true + # The URL of warning page (Please use "" to wrap the value). + # ! ---------------------------------------------------------------- + # ! Usually you don't need to set this option, just use the default. + # ! ---------------------------------------------------------------- + warning_url: https://support.dmeng.net/upgrade-your-browser.html + # Assets # In theme directory (source/css) css: css @@ -886,7 +896,7 @@ cdn: # leancloud_storage: //cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js valine: leancloud_storage: - + # minivaline # See: https://github.com/MiniValine/MiniValine # Example: diff --git a/layout/_partials/head/head.pug b/layout/_partials/head/head.pug index d636f2c64ffdfe8fd7b20e3f712a1939063b1b93..b7dc26a3c0c729a9820af0f298194015424c4ac2 100644 --- a/layout/_partials/head/head.pug +++ b/layout/_partials/head/head.pug @@ -28,8 +28,11 @@ meta(charset="UTF-8") meta(http-equiv="X-UA-Compatible" content="IE=edge") + +if (theme.kill_old_ie && theme.kill_old_ie.enable) + include ./kill-old-ie.pug + meta(name="viewport" content="width=device-width, initial-scale=1") -meta(name="renderer" content="webkit") meta(name="format-detection" content="telephone=no") meta(name="apple-mobile-web-app-capable" content="yes") meta(name="apple-mobile-web-app-status-bar-style" content="black") diff --git a/layout/_partials/head/kill-old-ie.pug b/layout/_partials/head/kill-old-ie.pug new file mode 100644 index 0000000000000000000000000000000000000000..11f03b45e06e6734a5ce49f04ce272df2f0fa153 --- /dev/null +++ b/layout/_partials/head/kill-old-ie.pug @@ -0,0 +1,7 @@ +meta(name="renderer" content="webkit") +meta(name="force-rendering" content="webkit") + +script. + if (/*@cc_on!@*/false || (!!window.MSInputMethodContext && !!document.documentMode)) { + window.location.href = '!{ theme.kill_old_ie.warning_url }'; + }