Skip to content

Commit

Permalink
✨ feat(posts): add Q&A
Browse files Browse the repository at this point in the history
  • Loading branch information
lqzhgood committed Nov 13, 2023
1 parent d28a680 commit a843743
Show file tree
Hide file tree
Showing 7 changed files with 535 additions and 312 deletions.
110 changes: 53 additions & 57 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { defineConfig } from "vitepress";
import { defineConfig } from 'vitepress';

const base = "/Shmily/";
const base = '/Shmily/';

export default defineConfig({
base,
lastUpdated: true,

head: [
['link', { rel: 'icon', type: 'image/png', href: `${base}favicon.png` }],
[
"link",
{ rel: "icon", type: "image/png", href: `${base}favicon.png` },
],
[
"script",
'script',
{},
`
var _hmt = _hmt || [];
Expand All @@ -36,114 +33,113 @@ export default defineConfig({
// ]
],

title: "Shmily",
lang: "zh-Hans-CN",
description: "Shmily docs",
title: 'Shmily',
lang: 'zh-Hans-CN',
description: 'Shmily docs',

themeConfig: {
logo: "/favicon.png",
nav: [{ text: "Demo演示地址", link: "http://demo.shmily.lqzh.me/" }],
logo: '/favicon.png',
nav: [{ text: 'Demo演示地址', link: 'http://demo.shmily.lqzh.me/' }],
sidebar: [
{
text: "指南",
text: '指南',
items: [
{ text: "这是啥", link: "/guide/what-is" },
{ text: "理念", link: "/guide/concept" },
{ text: '这是啥', link: '/guide/what-is' },
{ text: '理念', link: '/guide/concept' },
],
},
{
text: "使用说明",
text: '使用说明',
items: [
{ text: "Get", link: "/guide/use/get" },
{ text: "Merger", link: "/guide/use/merger" },
{ text: "Show", link: "/guide/use/show" },
{ text: 'Get', link: '/guide/use/get' },
{ text: 'Merger', link: '/guide/use/merger' },
{ text: 'Show', link: '/guide/use/show' },
],
},
{
text: "数据格式",
text: '数据格式',
items: [
{
text: "Shmily-Msg",
text: 'Shmily-Msg',
collapsed: true,
items: [
{
text: "标准",
link: "/guide/use/msg/schema",
text: '标准',
link: '/guide/use/msg/schema',
},
{
text: "示例",
link: "/guide/use/msg/template/index",
text: '示例',
link: '/guide/use/msg/template/index',
},
{
text: "自定义",
link: "/guide/use/msg/custom",
text: '自定义',
link: '/guide/use/msg/custom',
},
{
text: "其他",
text: '其他',
collapsed: true,
items: [
{
text: "表情数据",
link: "/guide/use/msg/other/emotion",
text: '表情数据',
link: '/guide/use/msg/other/emotion',
},
],
},
],
},
{ text: "Shmily-Data", link: "/guide/use/data" },
{ text: 'Shmily-Data', link: '/guide/use/data' },
],
},
{
text: "安装运行时环境",
text: '安装运行时环境',
collapsed: true,
items: [
{ text: "nodejs", link: "/guide/setup-runtime/nodejs" },
{ text: "python", link: "/guide/setup-runtime/python" },
{ text: "java", link: "/guide/setup-runtime/java" },
{ text: "php", link: "/guide/setup-runtime/php" },
{ text: "docker", link: "/guide/setup-runtime/docker" },
{ text: 'nodejs', link: '/guide/setup-runtime/nodejs' },
{ text: 'python', link: '/guide/setup-runtime/python' },
{ text: 'java', link: '/guide/setup-runtime/java' },
{ text: 'php', link: '/guide/setup-runtime/php' },
{ text: 'docker', link: '/guide/setup-runtime/docker' },
{ text: '常见问题', link: '/guide/setup-runtime/Q&A' },
],
},
{
text: "其他",
text: '其他',
items: [
{ text: "感谢", link: "/guide/other/thanks" },
{ text: '感谢', link: '/guide/other/thanks' },
{
text: '捐赠', link: "/guide/other/donation",
text: '捐赠',
link: '/guide/other/donation',
collapsed: true,
items:[
items: [
{
text: '门票公示',
link: "/guide/other/donation_list"
}
]
link: '/guide/other/donation_list',
},
],
},
],
},
],
outlineTitle: "这一页",
socialLinks: [
{ icon: "github", link: "https://github.com/lqzhgood/Shmily" },
],
outlineTitle: '这一页',
socialLinks: [{ icon: 'github', link: 'https://github.com/lqzhgood/Shmily' }],
footer: {
message: "GPLv3 License.",
copyright:
'Made by lqzh, Powered by <span style="color:red">♥</span>',
message: 'GPLv3 License.',
copyright: 'Made by lqzh, Powered by <span style="color:red">♥</span>',
},
editLink: {
pattern: "https://github.com/lqzhgood/Shmily/edit/main/docs/:path",
text: "Edit this page on GitHub",
pattern: 'https://github.com/lqzhgood/Shmily/edit/main/docs/:path',
text: 'Edit this page on GitHub',
},
lastUpdatedText: "Updated Date",
lastUpdatedText: 'Updated Date',
docFooter: {
prev: "上一页",
next: "下一页",
prev: '上一页',
next: '下一页',
},
},

vite: {
ssr: {
noExternal: ["vue-select"],
noExternal: ['vue-select'],
},
},
});
41 changes: 41 additions & 0 deletions docs/guide/setup-runtime/Q&A-detail/cannot-find-module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Cannot find module ‘xxxxxx’
author: '@appinn.com F124nk1e'
---

::: danger
Cannot find module ‘xxxxxx’
:::

<details> <summary>报错详情</summary>

```
Error: Cannot find module 'fs-extra'
Require stack:
- D:\transfer_redmi\AndroidQQ_MIUI\Shmily-Get-MobileQQ-Andriod\decode\utils\db.js
- D:\transfer_redmi\AndroidQQ_MIUI\Shmily-Get-MobileQQ-Andriod\tools\exportTable.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)
at Module._load (node:internal/modules/cjs/loader:893:27)
at Module.require (node:internal/modules/cjs/loader:1113:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (D:\transfer_redmi\AndroidQQ_MIUI\Shmily-Get-MobileQQ-Andriod\decode\utils\db.js:8:12)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Module._load (node:internal/modules/cjs/loader:930:12)
at Module.require (node:internal/modules/cjs/loader:1113:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\\transfer_redmi\\AndroidQQ_MIUI\\Shmily-Get-MobileQQ-Andriod\\decode\\utils\\db.js',
'D:\\transfer_redmi\\AndroidQQ_MIUI\\Shmily-Get-MobileQQ-Andriod\\tools\\exportTable.js'
]
}
Node.js v18.14.0
```

</details>

##### 解决办法

`nodejs` 没有安装依赖, 参考 [setup-nodejs](./nodejs.md)
12 changes: 12 additions & 0 deletions docs/guide/setup-runtime/Q&A-detail/list.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createContentLoader } from 'vitepress';
import path from 'path';
import { fileURLToPath } from 'node:url';

const files = path.join(path.dirname(fileURLToPath(import.meta.url)), './*.md');
console.log('🚀 ~ file: list.data.ts:6 ~ files:', files);

export default createContentLoader('guide/setup-runtime/Q&A-detail/*.md', {
includeSrc: true, // include raw markdown source?
render: true, // include rendered full page HTML?
excerpt: true, // include excerpt?
});
20 changes: 20 additions & 0 deletions docs/guide/setup-runtime/Q&A-detail/template.md.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: 简短的报错关键词
author: '作者'
---

::: danger
Cannot find module ‘xxxxxx’ // 详细的报错关键词 ,可以同 title
:::

<details> <summary>报错详情</summary>

```
// 报错信息贴在这
```

</details>

##### 解决办法

// 去外面转转~ 回来就好了.
42 changes: 42 additions & 0 deletions docs/guide/setup-runtime/Q&A.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Q & A

> 如需新增, 请新建 `docs/guide/setup-runtime/Q&A-detail/{新问题}.md`
>
> 内容参考模板 `docs/guide/setup-runtime/Q&A-detail/template.md.tpl`
## 常见问题

<script setup lang="ts">
import { data } from './Q&A-detail/list.data.ts'

</script>

<div>
<details v-for="d of data" class="qa-list">
<summary class="title">
<h4 class="link" target="_blank" > {{ d.frontmatter.title }}</h4>
<span class="author">by {{ d.frontmatter.author }}</span>
</summary>
<div class="detail" v-html="d.html"></div>
</details>
</div>

<style lang="sass">
.qa-list
.title
display: flex
&::before
content: '>'
margin-right: 10px
.link
flex: 1
cursor: pointer
.author
font-size: 12px
.detail
margin-left: 20px
background: aliceblue
padding: 5px 10px
border-bottom-left-radius: 10px
border-bottom-right-radius: 10px
</style>
Loading

0 comments on commit a843743

Please sign in to comment.