DOCUSAURUS 2-如何在移动视图中的Navbar中添加正确的项目中的一个按钮?
我想在Mobile View中的Navbar中添加一个按钮(很可能是GitHub链接)之类的项目,如下所示。
我没有在docusaurus.config.js
中看到任何选项。
navbar: {
items: [
{ to: "/docs/get-started", label: "HOME", position: "left" },
{ to: "/docs/get-started", label: "GET STARTED", position: "left" },
{ to: "/docs/learn", label: "LEARN", position: "left" },
{ to: "/docs/api", label: "API", position: "left" },
{
href: "https://dev.to/nucleoid",
label: "BLOG",
position: "left",
},
{
href: "https://github.com/NucleoidJS/Nucleoid",
html: require("fs").readFileSync("./github.html", "utf8"),
position: "right",
},
],
},
I'd like to add an item like a button (Most likely GitHub link) in right items to Navbar in mobile view like below.
I didn't see any option in docusaurus.config.js
for that.
navbar: {
items: [
{ to: "/docs/get-started", label: "HOME", position: "left" },
{ to: "/docs/get-started", label: "GET STARTED", position: "left" },
{ to: "/docs/learn", label: "LEARN", position: "left" },
{ to: "/docs/api", label: "API", position: "left" },
{
href: "https://dev.to/nucleoid",
label: "BLOG",
position: "left",
},
{
href: "https://github.com/NucleoidJS/Nucleoid",
html: require("fs").readFileSync("./github.html", "utf8"),
position: "right",
},
],
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于正确的Navbar项目将设置为
显示:无
当视口较小时996px
时,您可以使用自定义CSS覆盖它们,如下: docs
since the right navbar items will set to
display: none
when the viewport is smaller then996px
, you may override them with custom css as follow:mobile view setup are mentioned in the docs