Class: DocsUI::TopbarLinks

Inherits:
Phlex::HTML
  • Object
show all
Defined in:
app/components/docs_ui/topbar_links.rb

Overview

The config-driven repo/social links in the topbar, next to the theme switcher (DocsKit.configuration.topbar_links). Each link renders as an icon-only ghost button — a DocsUI::BrandMark (a shipped brand glyph like GitHub/Discord, or a lucide fallback) whose accessible name is the link's #label. External links open in a new tab with rel=noopener; a site-relative link opens in place.

Renders nothing when the site configures no links, so a site that sets c.topbar_links = [] (the default) has a byte-identical topbar.

Instance Method Summary collapse

Instance Method Details

#view_templateObject



13
14
15
16
17
18
# File 'app/components/docs_ui/topbar_links.rb', line 13

def view_template
  links = DocsKit.configuration.topbar_links
  return if links.empty?

  links.each { |link| topbar_link(link) }
end