Module: Bh::Helpers::Heads
- Included in:
- Bh::Helpers
- Defined in:
- lib/bh/helpers/heads.rb
Overview
What a page built on Bootstrap 6 puts in its <head>.
Constant Summary collapse
- INDENT =
One line per tag, each at the depth a head's children sit at in a layout indented by two:
<html>, then<head>, then these. "\n "
Instance Method Summary collapse
-
#bh_head_tags ⇒ Object
The metas Bootstrap and Turbo read, and the stylesheet and script this gem serves.
Instance Method Details
#bh_head_tags ⇒ Object
The metas Bootstrap and Turbo read, and the stylesheet and script this gem serves.
color-scheme is what lets light dark follow the system, so most pages need no
theme attribute at all. A page refresh Turbo is sent morphs the page in place and
keeps the scroll, so an answer landing in a thread leaves the reader where they were.
The icon font is the host's to link: which glyphs a page draws is the host's business,
and a gem reaching for somebody else's CDN on its own is not.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bh/helpers/heads.rb', line 15 def safe_join [ tag.(name: 'viewport', content: 'width=device-width, initial-scale=1'), tag.(name: 'color-scheme', content: 'light dark'), tag.(name: 'turbo-refresh-method', content: 'morph'), tag.(name: 'turbo-refresh-scroll', content: 'preserve'), tag.link(rel: 'stylesheet', href: "#{Engine::PREFIX}css/bh.css"), tag.script('', type: 'module', src: "#{Engine::PREFIX}js/bh.js"), ], INDENT end |