「Javascript/vue/vuepress」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→全文検索API) |
|||
| 行53: | 行53: | ||
===やり方=== | ===やり方=== | ||
| − | + | .vuepress/config.js | |
| + | <pre> | ||
| + | module.exports = { | ||
| + | themeConfig: { | ||
| + | algolia: { | ||
| + | apiKey: '<API_KEY>', | ||
| + | indexName: '<INDEX_NAME>' | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </pre> | ||
==参考== | ==参考== | ||
https://qiita.com/dojineko/items/aae7e6d13479e08d49fd | https://qiita.com/dojineko/items/aae7e6d13479e08d49fd | ||
2019年7月9日 (火) 11:13時点における版
vuepressとは
Markdownのドキュメントジェネレーター
サイトデザインなど変更
設定ファイル
.vuepress/config.js
カスタム変数用意
.vuepress/scripts/string.js
const string = {
example: {
mail: "hoge@example.com"
}
}
export default {
computed: {
$string () {
return string
}
}
}
.vuepress/enhanceApp.js
import strings from "./scripts/string"
export default ({
Vue,
options,
router,
siteData
}) => {
Vue.mixin(strings);
}
example1.md
ver:{{$string.example.mail}}'
全文検索API
Algolia DocSearch申請
https://community.algolia.com/docsearch/#join-docsearch-program
こんな感じの結果が1日で来る
apiKey: 'bb637hogehogegehohogehogegehohogehogegehoge', indexName: 'gehogehoge', https://github.com/algolia/docsearch-configs/blob/master/configs/hogehoge.json
参考:https://kitigai.hatenablog.com/entry/2019/04/04/133432
やり方
.vuepress/config.js
module.exports = {
themeConfig: {
algolia: {
apiKey: '<API_KEY>',
indexName: '<INDEX_NAME>'
}
}
}
