diff --git a/docs/.vitepress/stars.data.ts b/docs/.vitepress/stars.data.ts new file mode 100644 index 0000000000..1294be7d8b --- /dev/null +++ b/docs/.vitepress/stars.data.ts @@ -0,0 +1,9 @@ +// This file is auto-updated by xtasks/release-plz +// Current star count from GitHub API +export default { + load() { + return { + stars: "19.3k", + }; + }, +}; diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css index 299b93cd42..ffa3d4bd21 100644 --- a/docs/.vitepress/theme/custom.css +++ b/docs/.vitepress/theme/custom.css @@ -191,6 +191,52 @@ } } +/* GitHub star count badge */ +.VPSocialLinks a[href*="github.com/jdx/mise"] { + display: inline-flex !important; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 0; + position: relative; + padding-bottom: 12px !important; + margin-bottom: -12px !important; +} + +/* Ensure GitHub icon is visible and aligned */ +.VPSocialLinks a[href*="github.com/jdx/mise"] svg { + display: block !important; + width: 20px; + height: 20px; + margin-top: 2px; +} + +.VPSocialLinks .star-count { + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + font-size: 0.6rem; + font-weight: 600; + color: var(--vp-c-text-3); + font-family: var(--vp-font-family-mono); + letter-spacing: -0.02em; + transition: color 0.25s ease; + white-space: nowrap; + line-height: 1; +} + +.VPSocialLinks a[href*="github.com/jdx/mise"]:hover .star-count { + color: var(--vp-c-brand-1); +} + +/* Hide star count on mobile to save space */ +@media (max-width: 640px) { + .VPSocialLinks .star-count { + display: none; + } +} + /* Apply Bebas Neue to h1 headers, navigation, and key UI elements */ h1, .vp-doc h1, @@ -240,19 +286,14 @@ h1, } .VPHero .name { - background: linear-gradient( - 120deg, - #00d9ff 0%, - #52e892 50%, - #ff9100 100% - ); + background: linear-gradient(120deg, #00d9ff 0%, #52e892 50%, #ff9100 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 900; letter-spacing: -0.02em; - font-size: 5rem !important; + font-size: 6rem !important; line-height: 1.1 !important; animation: shimmer 3s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.3)); @@ -260,12 +301,7 @@ h1, /* Light mode hero gradient */ :root:not(.dark) .VPHero .name { - background: linear-gradient( - 120deg, - #00acc1 0%, - #4caf50 50%, - #ff9800 100% - ); + background: linear-gradient(120deg, #00acc1 0%, #4caf50 50%, #ff9800 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; @@ -565,13 +601,13 @@ div[class*="language-"] .copy:hover { /* Responsive improvements */ @media (max-width: 1024px) { .VPHero .name { - font-size: 4rem !important; + font-size: 5rem !important; } } @media (max-width: 768px) { .VPHero .name { - font-size: 3.5rem !important; + font-size: 4rem !important; } .VPHero .tagline { diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index c2a8c1b66d..5d1ee0b32f 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -3,10 +3,37 @@ import DefaultTheme from "vitepress/theme"; import { enhanceAppWithTabs } from "vitepress-plugin-tabs/client"; import "virtual:group-icons.css"; import "./custom.css"; +import { onMounted } from "vue"; +import { data as starsData } from "../stars.data"; export default { extends: DefaultTheme, enhanceApp({ app }) { enhanceAppWithTabs(app); }, + setup() { + onMounted(() => { + // Add star count to GitHub social link + const addStarCount = () => { + const githubLink = document.querySelector( + '.VPSocialLinks a[href*="github.com/jdx/mise"]', + ); + if (githubLink && !githubLink.querySelector(".star-count")) { + const starBadge = document.createElement("span"); + starBadge.className = "star-count"; + starBadge.innerHTML = starsData.stars; + starBadge.title = "GitHub Stars"; + githubLink.appendChild(starBadge); + } + }; + + // Try immediately and after a short delay to ensure DOM is ready + addStarCount(); + setTimeout(addStarCount, 100); + + // Also watch for route changes + const observer = new MutationObserver(addStarCount); + observer.observe(document.body, { childList: true, subtree: true }); + }); + }, } satisfies Theme; diff --git a/xtasks/release-plz b/xtasks/release-plz index dc92013487..c6a996a2a7 100755 --- a/xtasks/release-plz +++ b/xtasks/release-plz @@ -79,6 +79,33 @@ sed -i.bak "s/^[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\? macos-arm64 (a1b2d3e sed -i.bak "s/^Version: [0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?$/Version: $version/" packaging/rpm/mise.spec sed -i.bak "s/version = \"[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\";$/version = \"$version\";/" default.nix +# Update GitHub star count using gh CLI +stars_raw="$(gh api repos/jdx/mise --jq '.stargazers_count')" +if [[ -n $stars_raw ]]; then + if [[ $stars_raw -ge 1000 ]]; then + # Format as k notation (e.g., 19346 -> 19.3k) + stars_formatted="$(echo "scale=1; $stars_raw / 1000" | bc)k" + # Remove trailing .0k + stars_formatted="${stars_formatted/.0k/k}" + else + stars_formatted="$stars_raw" + fi + + # Update the stars data file + cat >docs/.vitepress/stars.data.ts <