From 5c3d1ed20c4b4d22fe28e848b78510a839885597 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sun, 21 Jan 2024 22:49:17 +0800 Subject: [PATCH] [opt] search placeholder & toc style --- layout/_partial/sidebar/search.ejs | 5 +++++ source/css/_layout/widgets/toc_wiki.styl | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/layout/_partial/sidebar/search.ejs b/layout/_partial/sidebar/search.ejs index 1ad124d..e27f9c6 100644 --- a/layout/_partial/sidebar/search.ejs +++ b/layout/_partial/sidebar/search.ejs @@ -2,6 +2,11 @@ if (item.filter == null) { item.filter = 'auto' } +if (item.placeholder == null && item.filter == 'auto') { + if (theme.wiki.tree[page.wiki]?.name) { + item.placeholder = __('search.search_in', theme.wiki.tree[page.wiki]?.name) + } +} function layoutDiv() { var el = '' el += `
` diff --git a/source/css/_layout/widgets/toc_wiki.styl b/source/css/_layout/widgets/toc_wiki.styl index e679e4a..e5c7801 100644 --- a/source/css/_layout/widgets/toc_wiki.styl +++ b/source/css/_layout/widgets/toc_wiki.styl @@ -55,7 +55,8 @@ border-bottom-left-radius: $border-card border-bottom-right-radius: $border-card a.toc-link:before - left: -2px + left: -7px width: 4px + background: var(--text-p2) a.toc-link:hover background: var(--alpha100)