Một mục mã nguồn mở trong kho dữ liệu GitHub của TopGit: seyhunak/twitter-bootstrap-rails, 4.5k sao, HTML. Twitter Bootstrap for Rails 8
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Every code snippet on the
Bootstrap 5.3 Introduction page
is reproducible from a command:
Docs snippet
Command
Starter template
rails g bootstrap:starter
CDN CSS <link>
rails g bootstrap:cdn --css
CDN JS bundle <script>
rails g bootstrap:cdn --js
Popper + bootstrap.js separately
rails g bootstrap:cdn --separate-popper
Important globals (doctype, lang, viewport)
baked into every generated layout and the starter template
# Install Bootstrap assets into the asset pipeline
rails g bootstrap:install static
# ...or load Bootstrap from the jsDelivr CDN instead
rails g bootstrap:install cdn
# Generate a Bootstrap layout
rails g bootstrap:layout application
# ...linking Bootstrap from the CDN, with Subresource Integrity
rails g bootstrap:layout application --cdn
# ...using Popper and bootstrap.js separately rather than the bundle
rails g bootstrap:layout application --cdn --separate-popper
# Write the starter template from the Bootstrap docs
rails g bootstrap:starter # -> public/bootstrap-starter.html
rails g bootstrap:starter --path=public/demo.html
# Print CDN tags to paste into a layout you already own (writes nothing)
rails g bootstrap:cdn
# Generate themed views for scaffold
rails g scaffold Task title:string done:boolean
rails db:migrate
rails g bootstrap:themed Tasks
bootstrap:install cdn records the choice in config/initializers/bootstrap.rb,
so bootstrap:layout emits CDN tags by default afterwards. Pass --cdn or
--no-cdn to override it per run.
Both asset pipelines are supported. On Sprockets, static adds require
directives to your manifests. On Propshaft (the Rails 8 default) there are no
directives to add, so the generated layout links the vendored files directly —
run rails g bootstrap:layout after bootstrap:install static either way.
The Bootstrap version and its CDN URLs and integrity hashes live in one place,
Twitter::Bootstrap::Rails::BOOTSTRAP_CDN. No template hardcodes them.
Snippets
Every snippet published at
getbootstrap.com/docs/5.3/examples
— 62 of them across 12 categories — is a command. Each writes an .html.erb
partial into app/views/shared/:
rails g bootstrap:header # the first variant, "centered"
rails g bootstrap:header dark_search # a specific variant
rails g bootstrap:header --list # what's available, with descriptions
Variants are listed in the order they appear on the docs page, so the first one
in each row is the first example Bootstrap shows.
Options, on every snippet command:
Option
Effect
--list
Print the variants with descriptions and exit, writing nothing
--as=NAME
Partial name to write (default: the generator name)
--path=DIR
Where to write it (default: app/views/shared)
--no-icons
Skip installing the shared icon sprite
rails g bootstrap:footer columns --as=site_footer --path=app/views/layouts
# -> app/views/layouts/_site_footer.html.erb
Placeholder images
Five snippets (hero centered, hero centered_screenshot, hero with_image,
hero cropped_image, features custom_cards) reference placeholder images that
only exist on Bootstrap's docs site, so they 404 until you point them at your own
assets. The generator warns you when you pick one.
Icons
36 of the 62 snippets use Bootstrap Icons through an SVG sprite. Those commands
also write _bootstrap_icons.html.erb next to the partial. Render it once,
near the top of <body> in your layout, or those icons come out as empty boxes:
Run bootstrap:layout even if you already have a layout — that step is what puts
Bootstrap's CSS and JS on the page.
Upgrading to 5.4.0
5.4.0 is a breaking release:
Less is gone.rails g bootstrap:install less no longer exists; the
argument is now static (default) or cdn. Bootstrap 5 has no Less build, and
the less-rails and execjs dependencies have been dropped.
Glyphicons are gone, including the glyph helper. Bootstrap dropped them in
v4. The snippet generators ship Bootstrap Icons instead.
CoffeeScript support is gone, along with --no-coffeescript.
The gem version no longer tracks the Bootstrap version.
Twitter::Bootstrap::Rails::BOOTSTRAP_VERSION says which Bootstrap ships.
If you are on Rails 8, note that bootstrap:install static previously left
Propshaft apps with no Bootstrap at all — that is fixed here. See the
CHANGELOG for the full list.
Sponsor
Open Collective — back the project with a one-off or monthly contribution
Patreon — become a patron
Bootstrap 5 for Rails — release write-up on Patreon
Buy me a Coffee
☕ Support the Project
Contributors
Thanks to all contributors who are helping to make better.
Star History
License
MIT. Copyright (c) 2025 (since 2011) by Seyhun Akyürek
Đọc thêm về seyhunak/twitter-bootstrap-rails ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/seyhunak/twitter-bootstrap-rails là nguồn chính thức.
seyhunak/twitter-bootstrap-rails có bao nhiêu sao?
seyhunak/twitter-bootstrap-rails có 4.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/seyhunak/twitter-bootstrap-rails. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
seyhunak/twitter-bootstrap-rails có những chủ đề gì?
GitHub topics của seyhunak/twitter-bootstrap-rails: "bootstrap", "bootstrap-generator", "rails-gem", "twitter-bootstrap-rails". TopGit xếp repo vào nhóm mã nguồn mở.
seyhunak/twitter-bootstrap-rails còn đang phát triển không?
Commit gần nhất trên seyhunak/twitter-bootstrap-rails là 8 ngày trước (theo timestamp GitHub). Repo có 978 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
seyhunak/twitter-bootstrap-rails viết bằng ngôn ngữ gì?
seyhunak/twitter-bootstrap-rails chủ yếu viết bằng HTML. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.