From 05a646a7ef4b001fd4cb314173812d0674a5a0ea Mon Sep 17 00:00:00 2001 From: Doge Date: Sat, 22 May 2021 20:59:07 +0800 Subject: Add site boardcast support with mourn mode --- _config.yml | 25 ++++++++++++++++++++++++- layout/_partial/head.ejs | 2 +- layout/index.ejs | 11 +++++++++++ layout/layout.ejs | 6 +++++- source/css/style.css | 5 +++++ source/css/style.min.css | 2 +- 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/_config.yml b/_config.yml index 4eb5da7..248dda1 100644 --- a/_config.yml +++ b/_config.yml @@ -110,4 +110,27 @@ rss: 'Education': ['How To', 'Language Learning'], 'Technology': [] } - explicit: false \ No newline at end of file + explicit: false + +# Boardcast info will show in top of the post list +# Color: +# default: grey +# danger: red +# info: blue +# warning: yellow +# ------------------------------------------------------------ +# 站点消息广播 - 会显示在首页的文章列表顶部 +# 广播块颜色选择: +# default: 灰色 +# danger: 红色 +# info: 蓝色 +# warning: 黄色 +boardcast: + enable: false + color: default + message: 'Memorial hero Yuan Longping.' + +# Site mourn mode, enable to get a global grayscale filter +# ------------------------------------------------------------ +# 站点悼念模式 - 启用后会为站点整体提供灰色滤镜 +mourn: false diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index e093db6..5e3296a 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -26,7 +26,7 @@ <% } %> - + \ No newline at end of file diff --git a/layout/index.ejs b/layout/index.ejs index 106b7f4..239edaa 100644 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -1,3 +1,14 @@ +<% if (theme.boardcast.enable) { %> +
+
+
+
+ <%= theme.boardcast.message %> +
+
+
+
+<% } %> <% page.posts.each(function (post) { %>
diff --git a/layout/layout.ejs b/layout/layout.ejs index db6dfb5..62c04c3 100644 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -1,5 +1,9 @@ - +<% if (theme.mourn) { %> + +<% } else { %> + +<% } %> <%- partial('_partial/head') %> <%- partial('_partial/header') %> diff --git a/source/css/style.css b/source/css/style.css index c088265..d35828d 100644 --- a/source/css/style.css +++ b/source/css/style.css @@ -3,6 +3,11 @@ pre { padding: 0%!important; } +#mourn { + filter: grayscale(1) !important; + -webkit-filter: grayscale(1) !important; +} + @media(prefers-color-scheme:dark) { * { transition: backgourd-color .5s diff --git a/source/css/style.min.css b/source/css/style.min.css index 95e1388..d20c049 100644 --- a/source/css/style.min.css +++ b/source/css/style.min.css @@ -1 +1 @@ -pre{background-color:none!important;padding:0!important}@media(prefers-color-scheme:dark){*{transition:backgourd-color .5s}.card{box-shadow:none!important;background-color:#121212!important}img:not([src*=".svg"]){filter:brightness(.7) contrast(1.2)}}@media screen and (max-width:1023px){.navbar-menu{box-shadow:0 8px 16px -8px rgb(10 10 10 / 10%)!important}.post-content{padding-top:0!important}.post-card{margin:0!important}}.post-podcast-player{padding-bottom:1.5rem}.post-card{margin:0 1rem 0 1rem}.navbar-brand .navbar-item:hover{background-color:inherit!important}.entry{margin-bottom:1.5rem!important;margin-top:1.5rem!important;transition:box-shadow .1s}.entry:hover{box-shadow:0 1em 2em -.125em rgb(10 10 10 / 10%),0 0 0 1px rgb(10 10 10 / 2%)}.pagination-bar{padding-left:.25rem;padding-right:.25rem}.footer{padding:1rem 1rem 1rem!important;background-color:transparent!important} \ No newline at end of file +pre{background-color:none!important;padding:0!important}#mourn{filter:grayscale(1)!important;-webkit-filter:grayscale(1)!important}@media(prefers-color-scheme:dark){*{transition:backgourd-color .5s}.card{box-shadow:none!important;background-color:#121212!important}img:not([src*=".svg"]){filter:brightness(.7) contrast(1.2)}}@media screen and (max-width:1023px){.navbar-menu{box-shadow:0 8px 16px -8px rgb(10 10 10 / 10%)!important}.post-content{padding-top:0!important}.post-card{margin:0!important}}.post-podcast-player{padding-bottom:1.5rem}.post-card{margin:0 1rem 0 1rem}.navbar-brand .navbar-item:hover{background-color:inherit!important}.entry{margin-bottom:1.5rem!important;margin-top:1.5rem!important;transition:box-shadow .1s}.entry:hover{box-shadow:0 1em 2em -.125em rgb(10 10 10 / 10%),0 0 0 1px rgb(10 10 10 / 2%)}.pagination-bar{padding-left:.25rem;padding-right:.25rem}.footer{padding:1rem 1rem 1rem!important;background-color:transparent!important} \ No newline at end of file -- cgit v1.2.3