VuePress¶
https://vuepress.vuejs.org/guide/getting-started.html
bundler: viteBundler({
viteOptions: {
server: {
allowedHosts: true,
},
},
}),
ref¶
<script setup>
import { ref } from 'vue'
const url = ref("http://haos.lan:8123")
</script>
- 1+3 url : <a :href="url">{{ url }}</a>
- <a target="_blank" :href="`${url}/config/developer-tools/state`">state</a>
theme hope¶
auto sidebar & search when dev: https://theme-hope.vuejs.press/guide/layout/sidebar.html#grouping-and-nesting
// .vuepress/config.ts
import { viteBundler } from "@vuepress/bundler-vite" # then `allowedHosts`, same above
// .vuepress/theme.ts
pageInfo: false, // will hide : author / page-reading-time-info
plugins: {
comment: false, // no github comment
},
sidebar¶
sidebar: {
"/": [
{
text: "", // Leave blank so it acts purely as a structural wrapper
icon: "", // Optional icon
collapsible: false, // Disables collapsing globally for all auto-generated groups
children: "structure", // Automatically builds the sidebar from your directory
},
],
},
# .vuepress/styles/palette.scss
/* 桌面端侧边栏宽度(默认 20rem) */
$sidebar-width: 12rem;
/* 移动端侧边栏宽度(默认是 20rem × 0.82) */
$sidebar-mobile-width: 10rem;
Hide Block¶
https://theme-hope.vuejs.press/guide/markdown/code/fence.html#line-collapsing
::: details Click to view code in a details container ```ts :collapsed-lines=15 hopeTheme({ markdown: { highlighter: { type: ‘shiki’, collapsedLines: false } } })
:::
## Github
```js
export default hopeTheme({
repo: 'your-org/your-repo', // navbar GitHub icon
docsRepo: 'your-org/your-docs', // if docs live in another repo
docsDir: 'docs', // dir inside repo
docsBranch: 'main', // edit link branch
editLink: true,