Add Hardware Home page#1456
Conversation
Greptile SummaryThis PR adds a new
Confidence Score: 4/5Safe to merge functionally, but the hardware page will always advertise itself to search engines and social platforms as a coding tracker, directly working against the page's purpose. The controller reuses set_homepage_seo_content unchanged, so every visit to /hardware sends coding-focused title, og:title, and meta description tags — the wrong metadata for a page explicitly targeting hardware makers. app/controllers/static_pages_controller.rb — the hardware action needs its own SEO content method rather than sharing the one written for the coding homepage. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Browser
participant Router as Rails Router
participant Controller as StaticPagesController
participant Cache as Cache::HomeStatsJob
participant Inertia
Browser->>Router: GET /hardware
Router->>Controller: hardware()
alt current_user present
Controller-->>Browser: redirect_to root_path
else guest
Controller->>Controller: set_homepage_seo_content()
Note over Controller: Sets coding-focused SEO tags
Controller->>Cache: perform_now
Cache-->>Controller: home_stats
Controller->>Inertia: render HardwareHome/SignedOut
Inertia-->>Browser: HTML + props
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Browser
participant Router as Rails Router
participant Controller as StaticPagesController
participant Cache as Cache::HomeStatsJob
participant Inertia
Browser->>Router: GET /hardware
Router->>Controller: hardware()
alt current_user present
Controller-->>Browser: redirect_to root_path
else guest
Controller->>Controller: set_homepage_seo_content()
Note over Controller: Sets coding-focused SEO tags
Controller->>Cache: perform_now
Cache-->>Controller: home_stats
Controller->>Inertia: render HardwareHome/SignedOut
Inertia-->>Browser: HTML + props
end
Reviews (2): Last reviewed commit: "Merge branch 'main' into hardware-home" | Re-trigger Greptile |
Summary
moved commits over from #1454. Current homepage is unfriendly to new hardware users, this PR adds a more friendly version of it at hackatime.hackclub.com/hardware