{"id":15512969,"url":"https://github.com/bootstrap-ruby/bootstrap-navbar","last_synced_at":"2025-04-04T23:06:36.019Z","repository":{"id":9494724,"uuid":"11386179","full_name":"bootstrap-ruby/bootstrap-navbar","owner":"bootstrap-ruby","description":"Helpers to generate a Twitter Bootstrap navbar","archived":false,"fork":false,"pushed_at":"2025-02-12T21:23:14.000Z","size":203,"stargazers_count":39,"open_issues_count":0,"forks_count":19,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T22:11:25.480Z","etag":null,"topics":["bootstrap","bootstrap-navbar"],"latest_commit_sha":null,"homepage":"http://bootstrap-ruby.github.io/bootstrap-navbar/","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/bootstrap-ruby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-13T09:54:09.000Z","updated_at":"2025-02-12T21:22:56.000Z","dependencies_parsed_at":"2025-03-28T22:11:11.858Z","dependency_job_id":"9cb0544f-c011-44c1-b1b1-899047268dbe","html_url":"https://github.com/bootstrap-ruby/bootstrap-navbar","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-navbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-navbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-navbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-navbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bootstrap-ruby","download_url":"https://codeload.github.com/bootstrap-ruby/bootstrap-navbar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261600,"owners_count":20910108,"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","bootstrap-navbar"],"created_at":"2024-10-02T09:53:57.674Z","updated_at":"2025-04-04T23:06:36.014Z","avatar_url":"https://github.com/bootstrap-ruby.png","language":"Ruby","readme":"# BootstrapNavbar\n\n[![Gem Version](https://badge.fury.io/rb/bootstrap-navbar.png)](http://badge.fury.io/rb/bootstrap-navbar)\n[![Build Status](https://secure.travis-ci.org/bootstrap-ruby/bootstrap-navbar.png)](http://travis-ci.org/bootstrap-ruby/bootstrap-navbar)\n[![Code Climate](https://codeclimate.com/github/bootstrap-ruby/bootstrap-navbar.png)](https://codeclimate.com/github/bootstrap-ruby/bootstrap-navbar)\n\nHelpers to generate a Bootstrap style navbar\n\n## Installation\n\nThis gem only provides a helper module with methods to generate HTML. It can be used by other gems to make these helpers available to a framework's rendering engine, e.g.:\n\n* For Rails: https://github.com/bootstrap-ruby/rails-bootstrap-navbar\n* For [Middleman](http://middlemanapp.com/): https://github.com/bootstrap-ruby/middleman-bootstrap-navbar\n\nIn short: __Unless you know what you're doing, do not use this gem directly in your app!__\n\n## Requirements\n\nOnly Bootstrap \u003e= 2.1.0 is supported. It might work with earlier versions as well though.\n\n## Setup\n\n### Set bootstrap_version (required)\n\nBootstrapNavbar needs to know what version of Bootstrap it's dealing with since each version has small changes compared to the previous one.\n\n```ruby\nBootstrapNavbar.configure do |config|\n  config.bootstrap_version = '4.0.0'\nend\n```\n\n### Set current_url_method (required)\n\nBootstrapNavbar has to be able to query for the current URL when rendering the navbar, e.g. to determine if a menu item is active or not. Since the way the current URL is determined varies depending on whether you use Rails, Sinatra, etc., this has to be set beforehand in some kind of initializer:\n\n```ruby\n# For Rails \u003e= 3.2\nBootstrapNavbar.configure do |config|\n  config.current_url_method = 'request.original_url'\nend\n```\n\n`current_url_method` should be set to a string which can be `eval`ed later.\n\n### Set up HTML escaping (optional)\n\nIf the framework or rendering engine that you use BootstrapNavbar with escapes HTML by default, you can instruct BootstrapNavbar to mark the returned HTML as html_safe by default by overriding `BootstrapNavbar#prepare_html`:\n\n```ruby\n# For Rails\nmodule BootstrapNavbar::Helpers\n  def prepare_html(html)\n    html.html_safe\n  end\nend\n```\n\n### Set up root paths (optional)\n\nWhen deciding whether a navbar link is marked as current, the following steps are followed:\n\n* If the link target is one of the root paths (only \"/\" by default), the link is only marked as current if the target is the current path.\n* Otherwise the link is marked as current if the target is the current path or a sub path of the current path.\n\nIn certain cases you might want to treat more paths as root paths, e.g. when different locales are mapped at \"/en\", \"/de\" etc. This can be achieved by setting the `root_paths` configuration.\n\n```ruby\nBootstrapNavbar.configure do |config|\n  config.root_paths = ['/', '/en', '/de'] # default: ['/']\nend\n```\n\nWith this configuration, if your brand link would be \"/en\" for example, it would not be marked as current if you are on \"/en/some-page\".\n\n### Mix in the helpers into the rendering engine (required)\n\n```ruby\n# For Rails\nActionView::Base.send :include, BootstrapNavbar::Helpers\n```\n\n## Usage\n\nSince the navbar format differs quite a bit between Bootstrap 2, 3 and 4, generating them using this gem works quite differently as well. Check out the Wiki pages for detailed instructions:\n\n[Usage with Bootstrap 2](https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-2)\n\n[Usage with Bootstrap 3](https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-3)\n\n[Usage with Bootstrap 4](https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-4)\n\n## Changes\n\nSee [CHANGELOG](CHANGELOG.md)\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## Support\n\nIf you like this project, consider [buying me a coffee](https://www.buymeacoffee.com/279lcDtbF)! :)\n","funding_links":["https://www.buymeacoffee.com/279lcDtbF)!"],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbootstrap-ruby%2Fbootstrap-navbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbootstrap-ruby%2Fbootstrap-navbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbootstrap-ruby%2Fbootstrap-navbar/lists"}