{"id":15512759,"url":"https://github.com/jbox-web/simple_navigation_bootstrap","last_synced_at":"2025-08-21T18:33:51.535Z","repository":{"id":56895795,"uuid":"61767189","full_name":"jbox-web/simple_navigation_bootstrap","owner":"jbox-web","description":"A Ruby gem that adds Bootstrap renderers for SimpleNavigation","archived":false,"fork":false,"pushed_at":"2024-12-15T00:15:40.000Z","size":88,"stargazers_count":9,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-15T00:18:07.274Z","etag":null,"topics":["bootstrap","menu","navigation","rails","ruby","simple-navigation"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbox-web.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-23T02:35:24.000Z","updated_at":"2024-12-15T00:15:44.000Z","dependencies_parsed_at":"2023-10-03T02:57:49.182Z","dependency_job_id":"95bc5d94-224f-4b80-b4ec-784435aaa0fd","html_url":"https://github.com/jbox-web/simple_navigation_bootstrap","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fsimple_navigation_bootstrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fsimple_navigation_bootstrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fsimple_navigation_bootstrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fsimple_navigation_bootstrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbox-web","download_url":"https://codeload.github.com/jbox-web/simple_navigation_bootstrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230527875,"owners_count":18240052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","menu","navigation","rails","ruby","simple-navigation"],"created_at":"2024-10-02T09:53:50.318Z","updated_at":"2024-12-20T03:10:26.780Z","avatar_url":"https://github.com/jbox-web.png","language":"Ruby","readme":"## SimpleNavigation Bootstrap\n\n[![GitHub license](https://img.shields.io/github/license/jbox-web/simple_navigation_bootstrap.svg)](https://github.com/jbox-web/simple_navigation_bootstrap/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/jbox-web/simple_navigation_bootstrap.svg)](https://github.com/jbox-web/simple_navigation_bootstrap/releases/latest)\n[![Gem](https://img.shields.io/gem/v/simple_navigation_bootstrap.svg)](https://rubygems.org/gems/simple_navigation_bootstrap/versions/1.0.1)\n[![Gem](https://img.shields.io/gem/dtv/simple_navigation_bootstrap.svg)](https://rubygems.org/gems/simple_navigation_bootstrap/versions/1.0.1)\n[![CI](https://github.com/jbox-web/simple_navigation_bootstrap/workflows/CI/badge.svg)](https://github.com/jbox-web/simple_navigation_bootstrap/actions)\n[![Code Climate](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap/badges/gpa.svg)](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap)\n[![Test Coverage](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap/badges/coverage.svg)](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap/coverage)\n\nThis gem adds Bootstrap renderers for [Simple Navigation](https://github.com/codeplant/simple-navigation). For now, it is include renderers for:\n\n* [Bootstrap 2 navigation](http://getbootstrap.com/2.3.2/components.html#navbar)\n* [Bootstrap 3 navigation](https://getbootstrap.com/docs/3.3/components/#navbar)\n* [Bootstrap 4 navigation](https://getbootstrap.com/docs/4.0/components/navbar/)\n\nWith these renderers you will be able create **any Bootstrap navigation elements**, such as: **submenu**, **navbar-text**, **divider**, **header**.\nAs well as add **icons** to menu elements, such as: Glyphicons, Font Awesome icons, even custom icons. Also you have **split** option for main menu containing submenu.\n\n*This gem is a fork of [ShPakvel/simple\\_navigation\\_renderers](https://github.com/ShPakvel/simple_navigation_renderers).*\n*After a year of waiting for [PR merge](https://github.com/ShPakvel/simple_navigation_renderers/pull/14) without any news from the author, I decided to fork it.*\n\n**This gem is compatible with SimpleNavigation 4.x.**\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'simple_navigation_bootstrap'\n```\n\nand then execute:\n\n```console\n$ bundle install\n```\n\nOr install it yourself as:\n\n```console\n$ gem install simple_navigation_bootstrap\n```\n\n## Usage\n\n### Simply set up renderer and you are done!!\n\nThere are two ways to say that you want to use any of renderers.\n\n1. You can specify it in you view as a parameter to `render_navigation`:\n\n    ```erb\n    ...\n      \u003c%= render_navigation(expand_all: true, renderer: :bootstrap2) %\u003e\n      # Or\n      \u003c%= render_navigation(expand_all: true, renderer: :bootstrap3) %\u003e\n    ...\n    ```\n\n2. Or you can set it in the very navigation configuration file (e.g. `config/navigation.rb`):\n\n    ```ruby\n    SimpleNavigation::Configuration.run do |navigation|\n      navigation.renderer = SimpleNavigationBootstrap::Bootstrap2\n      # or\n      navigation.renderer = SimpleNavigationBootstrap::Bootstrap3\n      # navigation itself goes here...\n    end\n    ```\n\n## Explicit example of using all features\n\nI think you already using `simple-navigation` gem and know how to define navigation items.\nIf not, you can always look at the [configuration instructions](https://github.com/andi/simple-navigation/wiki/Configuration) on the Simple Navigation wiki or read comments and examples in the generated by default `config/navigation.rb` file.\n\nIn addition to standard options you can use ones specific for Bootstrap renderers.\nLets look at the example:\n\n```ruby\nSimpleNavigation::Configuration.run do |navigation|\n  navigation.renderer = SimpleNavigationBootstrap::Bootstrap3\n\n  navigation.items do |primary|\n    primary.item :news, { icon: 'fa fa-fw fa-bullhorn', text: 'News' }, news_index_path\n    primary.item :concerts, 'Concerts', concerts_path\n    primary.item :video, 'Video', videos_path\n    primary.item :divider_before_info, '#', divider: true\n    primary.item :info, { icon: 'fa fa-fw fa-book', title: 'Info' }, info_index_path, split: true do |info_nav|\n      info_nav.item :main_info_page, 'Main info page', info_path(:main_info_page)\n      info_nav.item :about_info_page, 'About', info_path(:about_info_page)\n      info_nav.item :misc_info_pages, 'Misc.' do |misc_page|\n        misc_page.item :header_misc_pages, 'Misc. Pages', header: true\n        Info.all.each do |info_page|\n          misc_page.item :\"#{info_page.permalink}\", info_page.title, info_path(info_page)\n        end\n      end\n      info_nav.item :divider_before_contact_info_page, '#', divider: true\n      info_nav.item :contact_info_page, 'Contact', info_path(:contact_info_page)\n    end\n    primary.item :signed_in, 'Signed in as Pavel Shpak', navbar_text: true\n  end\nend\n```\n\n## Features\n\nSpecific options used in the example:\n\n|    Option     | Description\n|---------------|--------------\n|`:split`       | Use it to split first level item link with caret. If you add `split: true` option to item, then caret itself will toggle first level submenu and link will have standard behaviour, instead of toggle submenu. You can use `:split` only with first level items, for the rest it will not do anything.\n|`:navbar_text` | Use it as `navbar_text: true` to add Bootstrap `navbar-text`.\n|`:divider`     | Use it to add Bootstrap menu divider. if you add `divider: true` option to first level item, then it will create li-tag with `divider-vertical` Bootstrap 2 class. (You can add `divider-vertical` class to Bootstrap 3 - see below). For the second level item and deeper it will create `li` tag with class `divider` (which exists in both, Bootstrap 2 and 3).\n|`:header`      | Use it as `header: true` to add Bootstrap menu header. You can use `:header` only with submenus, for the first level items it will not do anything.\n|`:name hash`   | Use it in place of `:name` if you want. Hash can have three keys: `:text`, `:icon` and `:title`, which is only recognized. You can use it together or separately, but at least one of `:text` and `:icon` parameters should be provided.\n\nExample for `:name hash`:\n\n* `{ text: 'News', icon: 'fa fa-fw fa-bullhorn' }` will create Font Awesome icon and add text after it (name of the item)\n* `{ icon: 'glyphicon glyphicon-book', title: 'Info' }` will create Bootstrap icon with title without any text after it\n\n## Notes\n\n1. Bootstrap 3 has only one level submenu. If you want to use nested submenus as in example above, import `bootstrap2_dropdown_submenu.css.scss` file into your Sass file (e.g. `application.css.scss`) as following:\n\n    ```scss\n    @import \"bootstrap2_dropdown_submenu\";\n    ```\n\n2. Bootstrap 3 has not `divider-vertical` class. If you want to use it as in example above, import `bootstrap2_navbar_divider_vertical.css.scss` file:\n\n    ```scss\n    @import \"bootstrap2_navbar_divider_vertical\";\n    ```\n\n3. You may also want to include following file which changes some first level submenu style:\n\n    ```scss\n    @import \"simple_navigation_bootstrap_overrides\";\n    ```\n\n4. or you can add them all together:\n\n    ```scss\n    @import \"simple_navigation_bootstrap\";\n    ```\n\n## Test\n\nJust run following commands:\n\n```console\n$ bundle install\n$ rake\n```\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n\n## Contributors\n\nA big thank to [them](https://github.com/jbox-web/simple_navigation_bootstrap/blob/master/AUTHORS) for their contribution!\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbox-web%2Fsimple_navigation_bootstrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbox-web%2Fsimple_navigation_bootstrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbox-web%2Fsimple_navigation_bootstrap/lists"}