Skip to content

Commit b719420

Browse files
committed
Add search plugin, build docs task
1 parent 9581c09 commit b719420

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
.temp
33
.cache
44
docs/.vuepress/configs/modules.js
5+
docs/.vuepress/dist/
56
docs/*/modules/

docs/build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,20 @@ tasks.register('generateMarkdownModules') {
3030

3131
tasks.register('runDocsDev', Exec) {
3232
group = "documentation"
33-
description = "Run sample program"
33+
description = "Start docs dev server"
3434
dependsOn generateMarkdownModules
3535
workingDir '../docs/docs'
3636
commandLine 'pnpm', 'docs:dev'
3737
}
3838

39+
tasks.register('buildDocs', Exec) {
40+
group = "documentation"
41+
description = "Build docs to static site"
42+
dependsOn generateMarkdownModules
43+
workingDir '../docs/docs'
44+
commandLine 'pnpm', 'docs:build'
45+
}
46+
3947
tasks.register('generateModuleInfo', JavaExec) {
4048
group = "documentation"
4149
description = "Run sample program"

docs/docs/.vuepress/config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineUserConfig, defaultTheme } from 'vuepress'
22
import { getDirname, path } from '@vuepress/utils'
33
import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
44
import { prismjsPlugin } from '@vuepress/plugin-prismjs'
5+
import { searchPlugin } from '@vuepress/plugin-search'
56
import { sidebarConfig } from './configs/sidebar'
67
import { navbarConfig } from './configs/navbar'
78
import Prism from 'prismjs';
@@ -11,6 +12,7 @@ definePrismOwnLang(Prism)
1112
const __dirname = getDirname(import.meta.url)
1213

1314
export default defineUserConfig({
15+
base: "/docs/ownlang/",
1416
locales: {
1517
'/en/': {
1618
lang: 'en-US',
@@ -50,6 +52,12 @@ export default defineUserConfig({
5052
}),
5153
registerComponentsPlugin({
5254
componentsDir: path.resolve(__dirname, './components'),
53-
})
55+
}),
56+
searchPlugin({
57+
locales: {
58+
'/en/': { placeholder: 'Search' },
59+
'/ru/': { placeholder: 'Поиск' },
60+
},
61+
}),
5462
],
5563
})

docs/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ actions:
77
- text: 🇺🇸 English
88
link: /en/
99
type: primary
10-
- text: 🇷🇺 Русский
10+
- text: 🇪🇷 Русский
1111
link: /ru/
1212
type: primary
1313
footer: © 2024 aNNiMON

docs/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77
"docs:dev": "vuepress dev docs",
88
"docs:build": "vuepress build docs"
99
},
10-
"keywords": ["documentation", "ownlang", "programming-language"],
10+
"keywords": [
11+
"documentation",
12+
"ownlang",
13+
"programming-language"
14+
],
1115
"author": "aNNiMON",
1216
"license": "MIT",
1317
"devDependencies": {
1418
"@vuepress/client": "2.0.0-rc.0",
1519
"@vuepress/plugin-prismjs": "2.0.0-rc.0",
1620
"@vuepress/plugin-register-components": "2.0.0-rc.0",
21+
"@vuepress/plugin-search": "2.0.0-rc.0",
1722
"@vuepress/utils": "2.0.0-rc.0",
1823
"prismjs": "^1.29.0",
1924
"vue": "^3.3.8",

docs/pnpm-lock.yaml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)