Skip to content

Commit 626eddc

Browse files
fix: corrected the components
1 parent 52fc4de commit 626eddc

File tree

3 files changed

+45
-12
lines changed

3 files changed

+45
-12
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
import { getImage } from 'astro:assets';
3+
4+
interface Props {
5+
/** Image import from src/assets/ — processed by Astro's image pipeline */
6+
image: ImageMetadata;
7+
class?: string;
8+
}
9+
10+
const { image, class: className } = Astro.props;
11+
12+
const optimized = await getImage({
13+
src: image,
14+
format: 'webp',
15+
quality: 80,
16+
});
17+
---
18+
19+
<div
20+
class:list={['feature-visual', className]}
21+
style={`background-image: url('${optimized.src}');`}
22+
>
23+
<slot />
24+
</div>

docs/src/components/Terminal.astro

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
---
2+
import { getImage } from 'astro:assets';
3+
import bgImage from '../assets/bg.png';
4+
25
interface Props {
36
title?: string;
47
background?: 'custom';
58
}
69
710
const { title = "Terminal", background } = Astro.props;
811
const bgClass = background ? `bg-${background}` : '';
9-
const baseUrl = import.meta.env.BASE_URL;
10-
const base = baseUrl.endsWith('/') ? baseUrl : baseUrl + '/';
12+
13+
let bgStyle = '';
14+
if (background) {
15+
const optimized = await getImage({ src: bgImage, format: 'webp', quality: 80 });
16+
bgStyle = `--bg-image: url('${optimized.src}');`;
17+
}
1118
---
1219

13-
<div class={`terminal-wrapper ${bgClass}`} style={background ? `--bg-image: url('${base}bg.png');` : ''}>
20+
<div class={`terminal-wrapper ${bgClass}`} style={bgStyle}>
1421
<div class="terminal">
1522
<div class="terminal-header">
1623
<div class="terminal-dots">

docs/src/content/docs/index.mdx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import CommandBox from '../../components/CommandBox.astro';
1616
import InstallSelector from '../../components/InstallSelector.astro';
1717
import Terminal from '../../components/Terminal.astro';
1818
import FeatureTerminal from '../../components/FeatureTerminal.astro';
19-
20-
export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BASE_URL : import.meta.env.BASE_URL + '/';
19+
import FeatureVisual from '../../components/FeatureVisual.astro';
20+
import sectionBg1 from '../../assets/section-bg-1.png';
21+
import sectionBg2 from '../../assets/section-bg-2.png';
22+
import sectionBg3 from '../../assets/section-bg-3.png';
2123

2224
<div class="hero-command">
2325
<InstallSelector options={[
@@ -44,7 +46,7 @@ export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BAS
4446
<p>No config files. No flags. The CLI reads your <code>.env</code>, detects your project from the codebase, and just works. Monorepos, multiple orgs, complex setups — all handled automatically.</p>
4547
<p>Stop memorizing project slugs and DSNs. Start typing commands that make sense.</p>
4648
</div>
47-
<div class="feature-visual" style={`background-image: url('${base}section-bg-1.png');`}>
49+
<FeatureVisual image={sectionBg1}>
4850
<FeatureTerminal title="Terminal">
4951
<div class="line"><span class="prompt">$</span> <span class="command">sentry issue list</span></div>
5052
<div class="line dimmed">Detected project: my-app (from .env)</div>
@@ -70,7 +72,7 @@ export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BAS
7072
<span class="col-count">34</span>
7173
</div>
7274
</FeatureTerminal>
73-
</div>
75+
</FeatureVisual>
7476
</div>
7577
</section>
7678

@@ -81,7 +83,7 @@ export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BAS
8183
<p>Get AI-powered root cause analysis right in your terminal. Seer analyzes stack traces, related events, and your codebase to explain exactly what went wrong and why.</p>
8284
<p>Then run <code>sentry issue plan</code> to get a step-by-step fix you can apply immediately.</p>
8385
</div>
84-
<div class="feature-visual" style={`background-image: url('${base}section-bg-2.png');`}>
86+
<FeatureVisual image={sectionBg2}>
8587
<FeatureTerminal title="Terminal">
8688
<div class="line"><span class="prompt">$</span> <span class="command">sentry issue explain WQ</span></div>
8789
<div class="line dimmed">Analyzing MYAPP-WQ...</div>
@@ -92,7 +94,7 @@ export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BAS
9294
<div class="line dimmed">Affected: src/hooks/useUser.ts:42</div>
9395
<div class="line dimmed">Run `sentry issue plan` for a fix.</div>
9496
</FeatureTerminal>
95-
</div>
97+
</FeatureVisual>
9698
</div>
9799
</section>
98100

@@ -103,7 +105,7 @@ export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BAS
103105
<p>Structured JSON output for scripts and pipelines. Open issues directly in your browser. Pipe to <code>jq</code>, <code>fzf</code>, or your favorite tools.</p>
104106
<p>Built for humans and AI agents alike — every command is predictable, composable, and automation-ready.</p>
105107
</div>
106-
<div class="feature-visual" style={`background-image: url('${base}section-bg-3.png');`}>
108+
<FeatureVisual image={sectionBg3}>
107109
<FeatureTerminal title="Terminal">
108110
<div class="line"><span class="prompt">$</span> <span class="command">sentry org list --json | jq '.[0]'</span></div>
109111
<div class="spacer"></div>
@@ -114,6 +116,6 @@ export const base = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BAS
114116
<div class="line"> <span class="highlight">"members"</span>: 8</div>
115117
<div class="line">{"}"}</div>
116118
</FeatureTerminal>
117-
</div>
119+
</FeatureVisual>
118120
</div>
119-
</section>
121+
</section>

0 commit comments

Comments
 (0)