config in window.$docsify doesn't take effect
annotation can take effect, for instance:
.but config in window.$docsify doesn't take effect, for instance chat: { // chat panel title title: "Dialog", // set avatar url users: [ { nickname: "Yuki", avatar: "" }, { nickname: "Robot", avatar: "" }, ], },
Can you provide more detailed information? such as full config and page codes, as well as markdown content or console log. (。・∀・)ノ゙
the following is what I wrote in index.html
window.$docsify = {
name: "",
repo: "",
loadSidebar: true,
subMaxLevel: 3,
auto2top: true,
chat: {
os: "mac",
title: "title",
// set avatar url
users: [
{ nickname: "Yuki", avatar: "" },
{ nickname: "Robot", avatar: "" },
],
},
};
but as the picture show, the config didn't take effect
the js file is fetched from jsdelivr, so version of both docsify and docsify-chat depend on js file stored in jsdelivr.
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-chat/lib/docsify-chat.min.js"></script>
however, using annotation as config did take effect.
<!-- chat:start -->
<!-- self:Yuki -->
#### **Yuki**
hello
#### **Robot**
hello world
<!-- chat:end -->
<!-- tabs:start -->
in the code i set self:Yuki, and it works
Hey, I ran the code snippet you provided locally and successfully reproduced the issue you described, but this isn't a bug in the library itself.
I noticed you set the loadSidebar property to true in the config. According to the official documentation, when enabling loadSidebar, you need to create a corresponding _sidebar.md file in your documentation root directory. Alternatively, you can directly specify a custom MD file like loadSidebar: 'summary.md'.
After properly configuring the sidebar, the chat panel should render successfully on the page. The earlier content rendering issue was specifically caused by the sidebar not being loaded correctly.
By the way, I noticed the title and os properties in your code snippet weren't taking effect. I've fixed this issue, and you can now view the changes after clearing the CDN cache and refreshing the page. ( •̀ ω •́ )✧
The CDN synchronization may take several hours. You can check the docsify-chat version via $docsify.chat.version. When it displays 1.0.2, the functionality will work properly.
Thanks a lot!!!!! When the CDN refreshes, I will let you know if it works or have other bugs. ( •̀ ω •́ )✧
some advice: Allow other configurations to be set via annotations when needed in specific scenarios. 😊