feat(marketing): add platform detection for download button#558
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Nice ty for doing this with arch detection |
Summary
Adds a smart download button to the marketing landing page that automatically detects the visitor's operating system and provides the correct installer download.
What it does
navigator.userAgenton page loaddata-platformattribute on<html>and CSS visibility rulesapi.github.com/repos/pingdotgg/t3code/releases/latest) to get the available download assets.exefor Windows.dmgfor macOS (with arm64/x64 arch detection).AppImagefor LinuxsessionStorageto avoid redundant GitHub API calls during the same browser sessionPlatform icons
All three OS icons (Apple, Windows, Linux) are embedded as inline SVGs.
Note
Add platform detection and direct asset selection for the marketing index page Download button in index.astro
Introduce
script.detectPlatformandscript.pickAsset, update the hero Download anchor and label, fetch latest GitHub release on load, and set OS-specific href with icon and text viascript.init.📍Where to Start
Start with the initializer
script.initin index.astro to see platform detection, release fetching, and href updates.Macroscope summarized b9be1fe.