我正在尝试在 rmarkdown 导航栏中创建一个子菜单
这是我的 _site.yml
name: Test dashboard
navbar:
title: Test dashboard
left:
- text: by Commo (intake)
menu:
- text: "Menu"
href: index.html
- text: "SubMenu"
menu:
- text: "Item1"
- href: index2.html
- text: "Item2"
- href: index3.html
output:
html_document:
include:
after_body: footer.html
css: styles.css
source_code: embed
lib_dir: site_libs
mathjax: null
self_contained: false
output_dir: _site
但是,无论出于何种原因,子菜单的链接都无法正确显示。它们位于部分名称下方,位于具有几个像素高度的非常细的线上。
那有意义吗?
我在用
> packageVersion("rmarkdown")
[1] ‘2.1’
最佳答案
我相信我找到了它无法正常工作的原因。当我在 -
之前删除额外的破折号( href
)时s 在子菜单级别,一切似乎都没问题。
整个 _site.yml 看起来像这样:
name: Test dashboard
navbar:
title: Test dashboard
left:
- text: by Commo (intake)
menu:
- text: "Menu"
href: index.html
- text: "SubMenu"
menu:
- text: "Item1"
href: index2.html
- text: "Item2"
href: https://getbootstrap.com/docs/4.4/components/alerts/
output:
html_document:
include:
after_body: footer.html
css: styles.css
source_code: embed
lib_dir: site_libs
mathjax: null
self_contained: false
output_dir: _site
我使用相同的 rmarkdown 版本 (2.1)。
关于r - 如何在 rmarkdown 导航栏中使用子菜单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61400239/