Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dictionary-octopus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ environmentstate
environmenturl
eprintfn
esac
evenodd
exfiltrate
exfiltration
expressjs
Expand Down
3 changes: 3 additions & 0 deletions src/assets/icons/docker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/icons/helm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/icons/kubernetes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/icons/kustomize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/icons/octopus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/windows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/icons/yaml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 49 additions & 40 deletions src/components/Card.astro
Original file line number Diff line number Diff line change
@@ -1,62 +1,71 @@
---
import Arrow from './icons/Arrow.astro';
import List from './icons/List.astro';
import Youtube from './icons/Youtube.astro';

// Properties
// `icon` and `imgSrc` are mutually exclusive: a card can have one, the other, or neither.
// `icon` is the URL of an asset imported from src/assets/icons (e.g. `helmIcon.src`).
// `iconColor` picks how it's rendered: 'themed' (default) masks it with currentColor so
// it matches the surrounding theme, without duplicating SVG markup per card; 'branded'
// renders it as a plain img, preserving whatever colors are baked into the source file.
type Props = {
description?: string;
imgAlt: string;
imgSrc: string;
link: string;
title: string;
variant?: 'padded' | 'related-topics';
};
variant?: 'featured';
} & (
| {
icon: string;
iconColor?: 'themed' | 'branded';
imgAlt?: never;
imgSrc?: never;
}
| { icon?: never; iconColor?: never; imgAlt?: string; imgSrc?: string }
);

const { description, imgAlt, imgSrc, link, title, variant } =
Astro.props satisfies Props;
const {
description,
icon,
iconColor = 'themed',
imgAlt,
imgSrc,
link,
title,
variant,
} = Astro.props satisfies Props;

// Build class list based on the variant
const classList = [
'card',
variant === 'padded' ? 'card--padded' : '',
variant === 'related-topics' ? 'card--related-topics' : '',
]
const classList = ['card', variant === 'featured' ? 'card--featured' : '']
.join(' ')
.trim();

// Determine the icon type based on the link
const isYouTubeLink = link.includes('youtube.com') || link.includes('youtu.be');
const IconComponent = isYouTubeLink ? Youtube : List;

// Bottom label for related topics variant
const labelText = isYouTubeLink ? 'Watch Video' : 'Learn More';
---

<article class={classList}>
<a href={link} class="card__link" role="link" aria-label={`Open ${title}`}>
<div class="card__image-wrapper">
<img
src={imgSrc}
alt={imgAlt}
class="card__image"
onerror="this.src='https://i.octopus.com/library/step-templates/other.png';"
loading="lazy"
/>
</div>
<div class="card__copy">
<p class="card__title">{title}</p>
{description && <p class="card__description">{description}</p>}
{
imgSrc && (
<div class="card__image-wrapper">
<img
src={imgSrc}
alt={imgAlt}
class="card__image"
onerror="this.src='https://i.octopus.com/library/step-templates/other.png';"
loading="lazy"
/>
</div>
)
}
<div class="card__content">
{
variant === 'related-topics' && (
<div class="card__bottom">
<span class="card__label">
{labelText} <Arrow />
</span>
<IconComponent />
icon && (
<div class="card__icon-wrapper">
{iconColor === 'branded' ? (
<img src={icon} alt="" class="card__icon" />
) : (
<span class="card__icon" style={`--card-icon: url(${icon})`} />
)}
</div>
)
}
<p class="card__title">{title}</p>
{description && <p class="card__description">{description}</p>}
</div>
</a>
</article>
29 changes: 0 additions & 29 deletions src/components/IconTile.astro

This file was deleted.

138 changes: 0 additions & 138 deletions src/components/Related.astro

This file was deleted.

Loading