diff --git a/deploy.show.yml b/deploy.show.yml new file mode 100644 index 0000000..baac80f --- /dev/null +++ b/deploy.show.yml @@ -0,0 +1,20 @@ +service-my-project-integration: + ssh_host: user@remote-host.com + ssh_port: 12345 + repo_url: git@github.com:hailangvn/my-project.git + exec_start: python -m my_project.main + hooks: + pre-update: + - echo "Update starting" + pre-update-required: + - echo "Update required" + pre-update-success: + - echo "Pre-checks passed" + pre-update-fail: + - echo "Pre-checks failed" + post-update: + - echo "Post update" + post-update-success: + - echo "Update succeeded" + post-update-fail: + - echo "Update failed" diff --git a/site-docs/docs/demo.tape b/site-docs/docs/demo-1.tape similarity index 74% rename from site-docs/docs/demo.tape rename to site-docs/docs/demo-1.tape index cd32770..52f3605 100644 --- a/site-docs/docs/demo.tape +++ b/site-docs/docs/demo-1.tape @@ -2,7 +2,7 @@ # Showcases: installation, configure/update/status command help # ── Output ──────────────────────────────────────────────────────────────────── -Output ./site-docs/docs/demo.gif +Output ./site-docs/docs/demo-1.gif # ── Dependencies ────────────────────────────────────────────────────────────── Require deploy @@ -50,41 +50,22 @@ Enter Sleep 6s -# ── Scene 3: configure --help ───────────────────────────────────────────────── +# ── Scene 3: config file ────────────────────────────────────────────────────── Hide -Type "clear" -Enter -Show - -Sleep 500ms -Type "deploy configure --help" -Sleep 400ms +Type "cp deploy.show.yml deploy.yml" Enter - -Sleep 6s - -# ── Scene 4: update --help ──────────────────────────────────────────────────── -Hide Type "clear" Enter Show Sleep 500ms -Type "deploy update --help" +Type "vi deploy.yml" Sleep 400ms Enter +Type "zR" -Sleep 6s - -# ── Scene 5: status --help ──────────────────────────────────────────────────── -Hide -Type "clear" -Enter -Show +Sleep 12s -Sleep 500ms -Type "deploy status --help" -Sleep 400ms +Type ":q" +Sleep 1ms Enter - -Sleep 6s diff --git a/site-docs/docs/demo-2.tape b/site-docs/docs/demo-2.tape new file mode 100644 index 0000000..03e8346 --- /dev/null +++ b/site-docs/docs/demo-2.tape @@ -0,0 +1,71 @@ +# trobz-deploy terminal demo +# Showcases: installation, configure/update/status command help + +# ── Output ──────────────────────────────────────────────────────────────────── +Output ./site-docs/docs/demo-2.gif + +# ── Dependencies ────────────────────────────────────────────────────────────── +Require deploy + +# ── Settings ────────────────────────────────────────────────────────────────── +Set Shell bash +Set TypingSpeed 25ms +Set Width 2300 +Set Height 1600 +Set FontSize 49 +Set FontFamily "JetBrains Mono, Fira Code, monospace" +Set Theme { "name": "deploy", "background": "#111111", "foreground": "#f5f5f5", "cursor": "#ea580c", "black": "#2a2a2a", "red": "#ef4444", "green": "#22c55e", "yellow": "#eab308", "blue": "#3b82f6", "magenta": "#d946ef", "cyan": "#06b6d4", "white": "#f5f5f5", "brightBlack": "#52525b", "brightRed": "#f87171", "brightGreen": "#4ade80", "brightYellow": "#facc15", "brightBlue": "#60a5fa", "brightMagenta": "#e879f9", "brightCyan": "#22d3ee", "brightWhite": "#ffffff" } +Set WindowBar Colorful +Set WindowBarSize 60 +Set BorderRadius 15 +Set Margin 30 +Set Padding 40 +Set LineHeight 1.3 + +Hide +Type "export PS1='\[\033[38;2;249;115;22m\]❯\[\033[0m\] '" +Enter +Type "clear" +Enter +Show + +# ── Scene 4: configure command ──────────────────────────────────────────────── +Hide +Type "cp deploy.demo.yml deploy.yml" +Enter +Type "clear" +Enter +Show + +Sleep 500ms +Type "deploy configure service-my-project-integration" +Sleep 400ms +Enter + +Sleep 30s + +# ── Scene 5: update command ─────────────────────────────────────────────────── +Hide +Type "clear" +Enter +Show + +Sleep 500ms +Type "deploy update service-my-project-integration" +Sleep 400ms +Enter + +Sleep 30s + +# ── Scene 6: status command ─────────────────────────────────────────────────── +Hide +Type "clear" +Enter +Show + +Sleep 500ms +Type "deploy status service-my-project-integration" +Sleep 400ms +Enter + +Sleep 12s diff --git a/site-docs/docs/demo.gif b/site-docs/docs/demo.gif index c4f6f80..1e9170c 100644 Binary files a/site-docs/docs/demo.gif and b/site-docs/docs/demo.gif differ diff --git a/site-docs/docs/javascripts/commit-count.js b/site-docs/docs/javascripts/commit-count.js new file mode 100644 index 0000000..8d9d842 --- /dev/null +++ b/site-docs/docs/javascripts/commit-count.js @@ -0,0 +1,46 @@ +/** + * Fetches total commit count from the GitHub API and displays it + * in the #commit-count-badge element on the landing page. + * + * Uses the Link header pagination trick: request 1 commit per page, + * read the last page number from the Link header — that IS the count. + */ + +; (function () { + const GITHUB_REPO = 'trobz/deploy.py'; + + function formatCount(n) { + if (n >= 1000) return (n / 1000).toFixed(1).replace(/\.0$/, '') + 'k'; + return String(n); + } + + async function fetchCommitCount() { + const label = document.getElementById('github-commit-count'); + if (!label) return; + + try { + const res = await fetch( + `https://api.github.com/repos/${GITHUB_REPO}/commits?per_page=1`, + { headers: { Accept: 'application/vnd.github+json' } } + ); + if (!res.ok) return; + + const link = res.headers.get('Link') || ''; + const match = link.match(/[?&]page=(\d+)>;\s*rel="last"/); + if (!match) return; + + const total = parseInt(match[1], 10); + label.textContent = `${formatCount(total)} commits`; + } catch (_) { + // Silently fail — label stays with placeholder + } + } + + if (typeof document$ !== 'undefined') { + document$.subscribe(fetchCommitCount); + } else if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', fetchCommitCount); + } else { + fetchCommitCount(); + } +})(); diff --git a/site-docs/docs/stylesheets/hero.css b/site-docs/docs/stylesheets/hero.css index 4b4db9e..6720e9d 100644 --- a/site-docs/docs/stylesheets/hero.css +++ b/site-docs/docs/stylesheets/hero.css @@ -51,6 +51,32 @@ body:has(.ov-landing) .md-content__inner { align-items: flex-start; gap: 1.5rem; } +.ov-github-badge { + position: fixed; + top: 1.5rem; + right: 1.5rem; + z-index: 100; + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.6rem 1.2rem; + background: var(--ov-surface); + border: 1px solid var(--ov-border); + border-radius: 999px; + color: var(--ov-text) !important; + font-family: var(--ov-font-mono); + font-size: 0.85rem; + text-decoration: none; + backdrop-filter: blur(12px); + transition: all 0.2s ease; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +.ov-github-badge:hover { + background: var(--ov-border); + transform: translateY(-2px); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); +} .ov-split__demo { display: flex; align-items: center; justify-content: center; } diff --git a/site-docs/overrides/landing.html b/site-docs/overrides/landing.html index 5dfdde5..660366a 100644 --- a/site-docs/overrides/landing.html +++ b/site-docs/overrides/landing.html @@ -12,6 +12,14 @@ {# ── Three.js particle canvas (background layer) ── #} + + + + + 69 commits + + + {# ── Split layout: left = copy, right = demo/screenshot ── #}