Skip to content

Commit 5b05552

Browse files
committed
shocase page files minimum edition
1 parent e2a5d61 commit 5b05552

File tree

10 files changed

+111
-0
lines changed

10 files changed

+111
-0
lines changed

packages/astro-theme/components/nav/product/Nav.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ const firstDocsEntry = getLocalisedProductNav(
2424
)[0];
2525
if (!firstDocsEntry) throw new Error("must have a docs entry");
2626
let blogref = "/blog";
27+
let showcaseref = "/showcase";
2728
if (product.id.includes("cheerpj")) {
2829
blogref = "/docs/blog";
30+
showcaseref = "/docs/showcase";
2931
}
3032
---
3133

@@ -53,8 +55,11 @@ if (product.id.includes("cheerpj")) {
5355
<Search filterProductId={product.id} />
5456

5557
<div class="flex items-stretch gap-2 ml-auto px-2">
58+
5659
<Link label={t("Docs", Astro.currentLocale)} href={firstDocsEntry.href} />
5760
<Link label={t("Blog", Astro.currentLocale)} href={blogref} />
61+
<Link label={t("Demos", Astro.currentLocale)} href={showcaseref} />
62+
5863
</div>
5964

6065
<div class="flex items-center gap-4 flex-none text-stone-200">
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
import { CollectionEntry, getCollection } from "astro:content";
3+
import BlogPost from "../../layouts/BlogPost.astro";
4+
5+
export async function getStaticPaths() {
6+
const posts = await getCollection("showcase");
7+
return posts.map((project) => ({
8+
params: { slug: project.slug },
9+
props: project,
10+
}));
11+
}
12+
type Props = CollectionEntry<"showcase">;
13+
14+
const project = Astro.props;
15+
const { Content, headings } = await project.render();
16+
---
17+
18+
<BlogPost {...project.data} {headings} id={project.id}>
19+
<Content />
20+
</BlogPost>
130 KB
Loading
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
import { getCollection } from "astro:content";
3+
import { Image } from "astro:assets";
4+
import BlogPostCard from "../../components/BlogPostCard.astro";
5+
import Shell from "../../layouts/Shell.astro";
6+
import Footer from "../../components/Footer.astro";
7+
import BlogDoodle from "./blog-doodle.png";
8+
import { productFromUrl } from "../../lib/products";
9+
import ProductNav from "../../components/nav/product/Nav.astro";
10+
11+
const product = productFromUrl(Astro.url);
12+
13+
const [project1, project2, ...restProjects] = (
14+
await getCollection(
15+
"showcase",
16+
({ data }) =>
17+
(!product || data?.tags?.includes(product.name))
18+
)
19+
);
20+
---
21+
22+
<Shell
23+
title={`${product?.name ?? "Demo"} Showcase`}
24+
description="Read the latest updates from the Leaning Technologies development team about WebAssembly, compilers, and more."
25+
>
26+
{product && <ProductNav {product} />}
27+
<header class="text-center text-stone-100 py-16">
28+
<div class="flex justify-center items-center">
29+
<Image
30+
src={BlogDoodle}
31+
width="150"
32+
height="129"
33+
class="invisible md:visible"
34+
alt="person reading a newspaper"
35+
/>
36+
</div>
37+
38+
<h1 class="text-5xl font-semibold text-balance">
39+
{product?.name ?? "Engineering"} blog
40+
</h1>
41+
<p class="text-lg text-balance my-8 text-stone-400">
42+
News, technical writeups, and announcements directly from the development
43+
team.
44+
</p>
45+
<div
46+
class="bg-gradient-to-b from-primary-600 to-transparent opacity-20 w-full h-[40rem] absolute inset-0 -z-10"
47+
>
48+
<!-- cool background -->
49+
</div>
50+
</header>
51+
52+
<section class="pb-24 px-6 mx-auto w-full max-w-screen-xl">
53+
<ul class="grid md:grid-cols-2 gap-8 mb-8">
54+
{
55+
[project1, project2].map((project) => (
56+
<li class="flex md:justify-stretch md:items-stretch">
57+
{project && <BlogPostCard {project} showMetadata size="wide" />}
58+
</li>
59+
))
60+
}
61+
</ul>
62+
<ul class="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
63+
{
64+
restProjects.map((project) => (
65+
<li class="flex md:justify-stretch md:items-stretch">
66+
<BlogPostCard {project} showMetadata />
67+
</li>
68+
))
69+
}
70+
</ul>
71+
</section>
72+
73+
<Footer />
74+
</Shell>
242 KB
Loading
84.8 KB
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: iText
2+
description: Edit PDFs fully client side using the industry standard iText library converted to JavaScript.
3+
url: https://cheerpjdemos.leaningtech.com/iTextDemo.html
4+
heroImage: ./itext.png
5+
tags:
6+
- CheerpJ
-107 KB
Loading
117 KB
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: OpenAstexViewer
2+
description: A complex Java applet with 3D rendering running in any browser using CheerpJ.
3+
url: https://cheerpjdemos.leaningtech.com/OpenAstexViewer.html
4+
heroImage: ./openastex.png
5+
tags:
6+
- CheerpJ

0 commit comments

Comments
 (0)