且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Twitter Bootstrap Navbar 进行导航的正确方法是什么?

更新时间:2022-11-10 19:47:06

我从来没有发现任何关于这方面的讨论.Bootstrap 本身似乎使用了 hrefs 方法.作为用户,我发现这种方法是最容易理解的.

I never found any discussion on this one way or the other. Bootstrap itself seems to use the hrefs approach. As a user, I find this approach is the easiest to wrap your head around.

由于找不到关于如何有效使用这种方法的任何模板,我创建了自己的模板 称为自举烘焙.导航栏的 html 在所有***页面之间共享,使用 grunt-bake 模板任务.如果您只是想使用 Bootstrap 创建一个基本网站,这可能是一个不错的起点.

Since I couldn't find any templates on how to use this approach efficiently, I created my own template called bootstrap-baked. The html for the navbar, which is shared across all the top-level pages, is DRYed out in a single place using the grunt-bake template task. If you're just looking to create a basic site using Bootstrap, this might be a good place to start.

它使用 hrefs 通过导航栏导航,因此每个新页面都是一个新的 html 文件.它带有 yeoman webapp 生成器(配置为与 grunt-bake 配合使用)和响应式导航栏.

It uses hrefs to navigate via the navbar, so each new page is a new html file. It comes with all the tasks provided with the yeoman webapp generator (configured to play nice with grunt-bake), and a responsive navbar.