Skip to content

Commit bcf1321

Browse files
author
Lévai Norbert
committed
Change search plugin
1 parent cbd41f0 commit bcf1321

File tree

5 files changed

+768
-829
lines changed

5 files changed

+768
-829
lines changed

docs/.vuepress/config.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defaultTheme } from '@vuepress/theme-default'
22
import { defineUserConfig } from 'vuepress/cli'
33
import { viteBundler } from '@vuepress/bundler-vite'
4-
import { searchProPlugin } from "vuepress-plugin-search-pro";
4+
import { searchPlugin } from '@vuepress/plugin-search'
55

66
export default defineUserConfig({
77
lang: 'en-US',
@@ -263,20 +263,17 @@ export default defineUserConfig({
263263
],
264264
},
265265
}),
266-
266+
267267
plugins: [
268-
searchProPlugin({
269-
// Index all content
270-
indexContent: true,
271-
// Customize the fields to index
272-
customFields: [
273-
{
274-
getter: (page) => page.frontmatter.tags,
275-
formatter: "Tag: $content",
268+
searchPlugin({
269+
locales: {
270+
'/': {
271+
placeholder: 'Search',
276272
},
277-
],
273+
},
278274
}),
279275
],
276+
280277

281278
bundler: viteBundler({
282279
viteOptions: {

docs/.vuepress/styles/index.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,25 @@
33
--vp-c-accent: #f7931a;
44
--vp-c-accent-hover: #ef8007;
55
--vp-c-accent-text: #fff;
6+
--search-c-bg: var(--vp-c-bg);
7+
--search-c-accent: var(--vp-c-accent);
8+
--search-c-text: var(--vp-c-text);
9+
--search-c-border: var(--vp-c-gutter);
10+
--search-c-item-text: var(--vp-c-text-subtle);
11+
--search-c-item-focus: var(--vp-c-bg-alt);
12+
--search-input-width: 8rem;
13+
--search-result-width: 20rem;
614
}
715

816
.vp-hero-action-button.primary {
917
font-weight: bold;
18+
}
19+
20+
.search-box input {
21+
border: 1px solid var(--vp-c-border) !important;
22+
background-color: var(--vp-c-control) !important;
23+
color: var(--vp-c-text) !important;
24+
padding: 0 .9rem 0 2rem !important;
25+
font-size: 1rem !important;
26+
width: 150px !important;
1027
}

0 commit comments

Comments
 (0)