From 18fb91d6db7413549d47d05b569aca361b447fec Mon Sep 17 00:00:00 2001 From: AOAOSTAR <86001674+aoaostar@users.noreply.github.com> Date: Wed, 27 Apr 2022 14:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E8=A8=80=E4=B8=BAjs?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 2 +- layout/_partial/first-screen.ejs | 5 ++++- source/js/utils.js | 22 ---------------------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/_config.yml b/_config.yml index ab20c1d..fc7c0a6 100644 --- a/_config.yml +++ b/_config.yml @@ -40,7 +40,7 @@ style: enable: false background_img: /images/bg.svg # You can use local image or image external link description: Keep writing and Keep loving. - hitokoto: # Hitokoto api. https://v1.hitokoto.cn + hitokoto: # Hitokoto api. https://v1.hitokoto.cn/?encode=js # Scroll style settings scroll: diff --git a/layout/_partial/first-screen.ejs b/layout/_partial/first-screen.ejs index 5351a1f..398af3c 100644 --- a/layout/_partial/first-screen.ejs +++ b/layout/_partial/first-screen.ejs @@ -1,8 +1,11 @@
-
+
<%= theme.style.first_screen.description || config.description %>
+ <% if (theme.style.first_screen.hitokoto) { %> + + <% } %> <% if (theme.social_contact.enable) { %>
<% for (const key in theme.social_contact.links) { %> diff --git a/source/js/utils.js b/source/js/utils.js index f89e74f..58ddab0 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -330,25 +330,6 @@ KEEP.initUtils = () => { }, 200); }, - - // loading hitokoto - initHitokoto() { - - if (KEEP.theme_config.style.first_screen.enable === true && KEEP.theme_config.style.first_screen.hitokoto && window.location.pathname === '/') { - - fetch(KEEP.theme_config.style.first_screen.hitokoto) - .then((res) => { - return res.json(); - }) - .then((data) => { - this.firstScreen_dom.querySelector('.description').innerText = data.hitokoto; - }) - .catch((err) => { - console.error(err); - }) - } - - } } // init scroll @@ -378,7 +359,4 @@ KEEP.initUtils = () => { // set how long age in home article block KEEP.utils.setHowLongAgoInHome(); - // loading hitokoto - KEEP.utils.initHitokoto(); - }