From 4e323d79e6eca120a7bd6061aa70528626836d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AD=90=E7=90=A6?= Date: Fri, 1 Oct 2021 10:07:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=80=E6=9C=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2meta=20name=20description=E9=83=BD=E6=98=AFco?= =?UTF-8?q?nfig.description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/_partial/head.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 83a41a506..8149eec49 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -64,7 +64,7 @@ - + From a6a1e2ab2c676d3b6c8fe890bfe843d688ab7e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AD=90=E7=90=A6?= Date: Fri, 1 Oct 2021 15:17:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E8=BF=87api?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=BB=E9=A1=B5subtitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 21 ++++++ layout/_partial/bg-cover-content.ejs | 100 ++++++++++++++++++++------- 2 files changed, 97 insertions(+), 24 deletions(-) diff --git a/_config.yml b/_config.yml index 0d1ae35c0..ce5bd83f7 100644 --- a/_config.yml +++ b/_config.yml @@ -549,6 +549,27 @@ subtitle: sub: - 从来没有真正的绝境, 只有心灵的迷途 - Never really desperate, only the lost of the soul + api: + enable: true + + # 请求地址 + # Request url + url: "https://cdn.jsdelivr.net/gh/czqu/czqu.github.io@main/json/quote.json" + + # 请求方法 + # Request method + # Available: GET | POST | PUT + method: "GET" + + # 请求头 + # Request headers + headers: {} + + # 从请求结果获取字符串的取值字段,最终必须是一个字符串,例如返回结果为 {"data": {"author": "fluid", "content": "An elegant theme"}}, 则取值字段为 ['data', 'content'];如果返回是列表则自动选择第一项 + # The value field of the string obtained from the response. For example, the response content is {"data": {"author": "fluid", "content": "An elegant theme"}}, the expected `keys: ['data','content']`; if the return is a list, the first item is automatically selected + keys: + - ['data','translation'] + - ['data','content'] # 手机二级菜单. navMenu: diff --git a/layout/_partial/bg-cover-content.ejs b/layout/_partial/bg-cover-content.ejs index 8e54a02ee..1ab3a39e6 100755 --- a/layout/_partial/bg-cover-content.ejs +++ b/layout/_partial/bg-cover-content.ejs @@ -3,7 +3,7 @@
<% if (config.subtitle && config.subtitle.length > 0) { %> - <%= config.subtitle %> + <%= config.subtitle %> <% } else { %> subtitle <% } %> @@ -11,22 +11,74 @@
<% if (theme.subtitle.enable) { %> - - - + + <% }) %> + ], + startDelay: <%= theme.subtitle.startDelay %>, + typeSpeed: <%= theme.subtitle.typeSpeed %>, + loop: <%= theme.subtitle.loop %>, + backSpeed: <%= theme.subtitle.backSpeed %>, + showCursor: <%= theme.subtitle.showCursor %> + }); + <% } %> + <% } else { %> <%= config.description %> <% } %> @@ -36,13 +88,13 @@
<% if (theme.banner.enable) { %> - + <% } else { %> - + <% } %>