diff --git a/dictionary-octopus.txt b/dictionary-octopus.txt index 5be8f11598..cdcca35cbf 100644 --- a/dictionary-octopus.txt +++ b/dictionary-octopus.txt @@ -162,6 +162,7 @@ environmentstate environmenturl eprintfn esac +evenodd exfiltrate exfiltration expressjs diff --git a/src/assets/icons/docker.svg b/src/assets/icons/docker.svg new file mode 100644 index 0000000000..45d8981aff --- /dev/null +++ b/src/assets/icons/docker.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icons/helm.svg b/src/assets/icons/helm.svg new file mode 100644 index 0000000000..193b8bb737 --- /dev/null +++ b/src/assets/icons/helm.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/icons/kubernetes.svg b/src/assets/icons/kubernetes.svg new file mode 100644 index 0000000000..de68ed526f --- /dev/null +++ b/src/assets/icons/kubernetes.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/icons/kustomize.svg b/src/assets/icons/kustomize.svg new file mode 100644 index 0000000000..f892f22f28 --- /dev/null +++ b/src/assets/icons/kustomize.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/icons/octopus.svg b/src/assets/icons/octopus.svg new file mode 100644 index 0000000000..860377b32f --- /dev/null +++ b/src/assets/icons/octopus.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/src/assets/icons/windows.svg b/src/assets/icons/windows.svg new file mode 100644 index 0000000000..e55760be02 --- /dev/null +++ b/src/assets/icons/windows.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icons/yaml.svg b/src/assets/icons/yaml.svg new file mode 100644 index 0000000000..e73984aaa0 --- /dev/null +++ b/src/assets/icons/yaml.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/components/Card.astro b/src/components/Card.astro index 9e61d1d4a0..7d5fedb98e 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -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'; ---
-
- {imgAlt} -
-
-

{title}

- {description &&

{description}

} + { + imgSrc && ( +
+ {imgAlt} +
+ ) + } +
diff --git a/src/components/IconTile.astro b/src/components/IconTile.astro deleted file mode 100644 index 6f753de2a3..0000000000 --- a/src/components/IconTile.astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -// Properties -type Props = { - description?: string; - iconAlt: string; - iconSrc: string; - link: string; - title: string; -}; - -const { description, iconAlt, iconSrc, link, title } = - Astro.props satisfies Props; ---- - - -
- {iconAlt} -
-
-

{title}

- {description &&

{description}

} -
-
diff --git a/src/components/Related.astro b/src/components/Related.astro deleted file mode 100644 index aa26152f21..0000000000 --- a/src/components/Related.astro +++ /dev/null @@ -1,138 +0,0 @@ ---- -import { accelerator } from '@lib/accelerator'; -import { PostFiltering, PostOrdering } from 'astro-accelerator-utils'; -import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter'; -import { SITE } from '@config'; -import type { MarkdownInstance } from 'astro'; -import { Translations, Lang } from '@util/Languages'; -import { getImageInfo } from '@util/custom-markdown.mjs'; - -import AuthorsMini from '@components/AuthorsMini.astro'; - -const stats = new accelerator.statistics('components/Related.astro'); -stats.start(); - -// Properties -type Props = { - lang: string; - frontmatter: Frontmatter; - headings: { depth: number; slug: string; text: string }[]; -}; -const { lang, frontmatter, headings } = Astro.props satisfies Props; - -// Language -const _ = Lang(lang); - -// Logic -let relatedPosts: MarkdownInstance>[] = []; -const parentCategory = (frontmatter.categories ?? [null])[0]; - -if (parentCategory != null) { - const allPages = accelerator.posts.all().filter(PostFiltering.isListable); - const allPosts = allPages - .filter(PostFiltering.showInMenu) - .filter( - (p) => - p.frontmatter.title != frontmatter.title && - p.frontmatter.categories && - p.frontmatter.categories.includes(parentCategory) - ) - .sort(PostOrdering.sortByPubDateDesc); - - // One "Most Recent" Post - if (allPosts.length > 0) { - relatedPosts.push(allPosts[0]); - } - - const olderPost = allPosts - .slice(1) - .filter((p) => p.frontmatter.pubDate < frontmatter.pubDate); - - // One "Older than current" Post - if (olderPost.length > 0) { - relatedPosts.push(olderPost[0]); - } else if (allPosts.length > 1) { - relatedPosts.push(allPosts[1]); - } -} - -type ImageInfo = { - src: string; - srcset: string; - sizes: string; - class: string; -}; - -type Article = { - title: string; - url: string; - frontmatter: Record; - img: ImageInfo | null; -}; - -const articles: Article[] = []; - -for (let p of relatedPosts) { - const item = { - title: await accelerator.markdown.getTextFrom(p.frontmatter.title), - url: p.url ?? '', - frontmatter: p.frontmatter, - img: p.frontmatter.bannerImage - ? getImageInfo(p.frontmatter.bannerImage.src, '', SITE.images.listerSize) - : null, - }; - - articles.push(item); -} - -stats.stop(); ---- - -{ - articles.length > 0 && ( - - ) -} diff --git a/src/components/icons/Arrow.astro b/src/components/icons/Arrow.astro index 52ce685f8d..c39c745762 100644 --- a/src/components/icons/Arrow.astro +++ b/src/components/icons/Arrow.astro @@ -1,3 +1,11 @@ - - - \ No newline at end of file + + + diff --git a/src/components/icons/List.astro b/src/components/icons/List.astro deleted file mode 100644 index 8d8f104016..0000000000 --- a/src/components/icons/List.astro +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/icons/Youtube.astro b/src/components/icons/Youtube.astro deleted file mode 100644 index fa1ac67003..0000000000 --- a/src/components/icons/Youtube.astro +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/data/language.json b/src/data/language.json index a9c52ee6e2..265310a2e4 100644 --- a/src/data/language.json +++ b/src/data/language.json @@ -9,14 +9,6 @@ "en": "Parent Site Navigation" } }, - "octopus_related": { - "related_title": { - "en": "More resources" - }, - "read_more": { - "en": "Read more" - } - }, "octopus_footer": { "last_updated": { "en": "Last updated" diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index f93471ce15..9f0fd7b565 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -18,7 +18,6 @@ import ArticleHeader from '../components/ArticleHeader.astro'; import ArticleNav from '../components/ArticleNav.astro'; import Feedback from '../components/Feedback.astro'; import Header from '../components/Header.astro'; -import Related from '../components/Related.astro'; import EditOnGithub from '../components/EditOnGithub.astro'; import CopyAsMarkdown from '../components/CopyAsMarkdown.astro'; import MarkdownLinks from '../components/MarkdownLinks.astro'; @@ -112,7 +111,6 @@ const lastUpdated = frontmatter.modDate ?? frontmatter.pubDate ?? null;