Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ pnpm-debug.log*
# macOS-specific files
.DS_Store

# content dir copied from astro-theme
sites/*/src/content/blog
sites/*/src/content/blogauthors
sites/*/src/content/showcase
Binary file removed content/showcase/browsercraft.png
Binary file not shown.
Binary file removed content/showcase/homebyme.png
Binary file not shown.
Binary file removed content/showcase/javafiddle.png
Binary file not shown.
Binary file removed content/showcase/phet.png
Binary file not shown.
Binary file removed content/showcase/swingset3.png
Binary file not shown.
Binary file removed content/showcase/webvm.png
Binary file not shown.
8 changes: 2 additions & 6 deletions packages/astro-theme/components/nav/product/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ const firstDocsEntry = getLocalisedProductNav(
Astro.currentLocale
)[0];
if (!firstDocsEntry) throw new Error("must have a docs entry");
let blogref = "/blog";
let showcaseref = "/showcase";
if (product.id.includes("cheerpj") || product.id.includes("browserpod")) {
blogref = "/docs/blog";
showcaseref = "/docs/showcase";
}
let blogref = "https://labs.leaningtech.com/blog";
let showcaseref = "https://labs.leaningtech.com/showcase";
---

<nav
Expand Down
54 changes: 29 additions & 25 deletions packages/astro-theme/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,9 @@ const languages = z.enum(["en", "ja"]);
export type ProductTag = z.infer<typeof productTags>[0];
export type LanguageContent = z.infer<typeof languages>;

export function defineCommonCollections() {
export function defineLabsCollections() {
return {
docs: defineCollection({
// These are passed to DocsArticle.astro
schema: z.object({
title: z.string(),
description: z.string().optional(),
shortTitle: z.string().optional(), // Used for nav only
fullWidthLayout: z.boolean().default(false),
draft: z.boolean().default(false),
language: languages.default("en"),
}),
}),

blogauthors: defineCollection({
schema: ({ image }) =>
z.object({
name: z.string(),
jobTitle: z.string().optional(),
avatar: image().optional(),
url: z.string().optional(),
guest: z.boolean().default(false),
}),
type: "data",
}),

...defineCommonCollections(),
blog: defineCollection({
schema: ({ image }) =>
z.object({
Expand All @@ -56,6 +33,17 @@ export function defineCommonCollections() {
tags: productTags.optional(),
}),
}),
blogauthors: defineCollection({
schema: ({ image }) =>
z.object({
name: z.string(),
jobTitle: z.string().optional(),
avatar: image().optional(),
url: z.string().optional(),
guest: z.boolean().default(false),
}),
type: "data",
}),
showcase: defineCollection({
schema: ({ image }) =>
z.object({
Expand All @@ -73,3 +61,19 @@ export function defineCommonCollections() {
}),
};
}

export function defineCommonCollections() {
return {
docs: defineCollection({
// These are passed to DocsArticle.astro
schema: z.object({
title: z.string(),
description: z.string().optional(),
shortTitle: z.string().optional(), // Used for nav only
fullWidthLayout: z.boolean().default(false),
draft: z.boolean().default(false),
language: languages.default("en"),
}),
}),
};
}
23 changes: 0 additions & 23 deletions packages/astro-theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import rehypeSlug from "rehype-slug";
import rehypeExternalLinks from "rehype-external-links";
import { type AstroIntegration } from "astro";
import { addIntegration } from "astro-integration-kit";
import { cpSync } from "fs";
import { join as joinPath } from "path";

const prod = process.env.NODE_ENV === "production";

Expand All @@ -37,8 +35,6 @@ export type Options = {
baseIsDocs?: boolean; // Only true for cheerpj site
};

const contentDir = joinPath(dirname, "../../content");

export default function ThemeIntegration(
options: Options = {}
): AstroIntegration {
Expand Down Expand Up @@ -73,16 +69,6 @@ export default function ThemeIntegration(
addIntegration(params, { integration });
}

params.injectRoute({
pattern: "blog",
entrypoint: "@leaningtech/astro-theme/pages/blog/index.astro",
});
params.injectRoute({
pattern: "blog/[...slug]",
entrypoint: "@leaningtech/astro-theme/pages/blog/[...slug].astro",
});
cpSync(contentDir, "src/content", { recursive: true }); // Needed until Astro Content Layer implemented

const docsPrefix = options.baseIsDocs ? "" : "docs";
params.injectRoute({
pattern: docsPrefix,
Expand All @@ -96,15 +82,6 @@ export default function ThemeIntegration(
pattern: `${docsPrefix}/[...slug]`,
entrypoint: "@leaningtech/astro-theme/pages/docs/[...slug].astro",
});
//routing for demos showcase
params.injectRoute({
pattern: "showcase",
entrypoint: "@leaningtech/astro-theme/pages/showcase/index.astro",
});
params.injectRoute({
pattern: "showcase/[...slug]",
entrypoint: "@leaningtech/astro-theme/pages/showcase/[...slug].astro",
});
params.updateConfig({
markdown: {
remarkPlugins: [[remarkObsidianCallout, {}], remarkReplaceVars],
Expand Down
9 changes: 5 additions & 4 deletions packages/astro-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
".": "./index.ts",
"./consts": "./consts.ts",
"./products": "./lib/products.ts",
"./nav": "./lib/nav.ts",
"./components/nav/product/Nav.astro": "./components/nav/product/Nav.astro",
"./layouts/BlogPost.astro": "./layouts/BlogPost.astro",
"./layouts/DemoArticle.astro": "./layouts/DemoArticle.astro",
"./components/DemoCard.astro": "./components/DemoCard.astro",
"./content": "./content.ts",
"./tailwind": "./tailwind.ts",
"./pages/blog/index.astro": "./pages/blog/index.astro",
"./pages/showcase/index.astro": "./pages/showcase/index.astro",
"./pages/blog/[...slug].astro": "./pages/blog/[...slug].astro",
"./pages/showcase/[...slug].astro": "./pages/showcase/[...slug].astro",
"./pages/docs/index.astro": "./pages/docs/index.astro",
"./pages/docs/404.astro": "./pages/docs/404.astro",
"./pages/docs/[...slug].astro": "./pages/docs/[...slug].astro",
Expand Down
Binary file removed sites/cheerp/src/content/showcase/boardspace.png
Binary file not shown.
Binary file not shown.
Binary file removed sites/cheerp/src/content/showcase/cjdom.png
Binary file not shown.
Binary file not shown.
Binary file removed sites/cheerp/src/content/showcase/homebyme.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed sites/cheerp/src/content/showcase/phet.png
Binary file not shown.
Binary file removed sites/cheerp/src/content/showcase/swingset3.png
Binary file not shown.
Binary file removed sites/cheerp/src/content/showcase/webvm.png
Binary file not shown.
18 changes: 1 addition & 17 deletions sites/cheerp/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -182,23 +182,7 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
</div>
</div>
</section>
<section class="bg-stone-900 py-16">
<div class="w-full max-w-screen-2xl mx-auto px-16">
<div class="mb-8">
<p class="text-lg text-stone-400">Cheerp blog</p>
<h2 class="text-4xl font-bold text-white">Latest news</h2>
</div>
<BlogPostCardSet />
<div class="mt-8">
<LinkButton
type="secondary-cheerp"
href="/blog"
label="View all blog posts"
iconRight="mi:arrow-right"
/>
</div>
</div>
</section>

<section
class="bg-gradient-to-b from-stone-900 to-[#474484] pb-48 text-center pb-28 md:px-8 md:pt-16 lg:px-32 lg:pt-32 xl:pt-42 xl:px-28 2xl:px-60 2xl:pt-60"
>
Expand Down
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/HomeByMe.yml

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/boardspace.yml

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/browsercraft.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/cjdom.png
Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/cjdom.yml

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/dragoncourtrevived.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/homebyme.png
Binary file not shown.
Binary file removed sites/cheerpj/src/content/showcase/imagej.webp
Binary file not shown.
7 changes: 0 additions & 7 deletions sites/cheerpj/src/content/showcase/imagej.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/itext.png
Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/itext.yml

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/javafiddle.yml

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/nasa-applets.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/openastex.png
Diff not rendered.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/openastex.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/phet.png
Diff not rendered.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/phet.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/swingset3.png
Diff not rendered.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/swingset3.yml

This file was deleted.

Binary file removed sites/cheerpj/src/content/showcase/webvm.png
Diff not rendered.
6 changes: 0 additions & 6 deletions sites/cheerpj/src/content/showcase/webvm.yml

This file was deleted.

Diff not rendered.
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/cjdom.png
Diff not rendered.
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/homebyme.png
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/itext.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/openastex.png
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/phet.png
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/swingset3.png
Diff not rendered.
Binary file removed sites/cheerpx/src/content/showcase/webvm.png
Diff not rendered.
18 changes: 1 addition & 17 deletions sites/cheerpx/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,7 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
</div>
</div>
</section>
<section class="bg-black py-16">
<div class="w-full max-w-screen-2xl mx-auto px-16">
<div class="mb-8">
<p class="text-lg text-stone-400">CheerpX blog</p>
<h2 class="text-4xl font-bold text-white">Latest news</h2>
</div>
<BlogPostCardSet />
<div class="mt-8">
<LinkButton
type="secondary-cheerpx"
href="/blog"
label="View all blog posts"
iconRight="mi:arrow-right"
/>
</div>
</div>
</section>

<section
class="bg-gradient-to-b from-black to-[#00254d] pb-48 text-center pb-28 md:px-8 md:pt-16 lg:px-32 pt-12 lg:pt-32 xl:pt-42 xl:px-28 2xl:px-60 2xl:pt-60"
>
Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 4 additions & 7 deletions sites/labs/src/content/blog/CJ-4-3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,9 @@ CheerpJ is not only a powerful tool for reviving legacy applications in the brow

<figure class="w-full">
![JavaFiddle screenshot](./javafiddle.png)
<figcaption class="text-center">
JavaFiddle Demo Screenshot
</figcaption>
<figcaption class="text-center">JavaFiddle Demo Screenshot</figcaption>
</figure>


Since the 4.2 release, we have also continued to improve the stability and performance of our Java 11 and 17 runtimes. Full graphical applications such as the FlatLaf Demo, a popular Look and Feel for Java, now run smoothly in the browser with CheerpJ.

<figure class="w-full aspect-square">
Expand Down Expand Up @@ -221,9 +218,9 @@ demoDivFlatLaf.onfullscreenchange = function()
Unlike native applications, web applications running in the browser cannot access the local filesystem directly, due to the browser's sandboxed environment. To allow Java applications to interact with files as they would natively, CheerpJ provides a virtual UNIX-style filesystem with multiple mounting points, each serving a specific purpose:

<div style="padding-left: 40px">
**/app/** — Read-only access to files served from your web server
**/files/** — Persistent read/write storage for Java, backed by IndexedDB
**/str/** — A transient mount for passing data from JavaScript to Java
**/app/** — Read-only access to files served from your web server **/files/**
— Persistent read/write storage for Java, backed by IndexedDB **/str/** — A
transient mount for passing data from JavaScript to Java
</div>

Whenever a Java application triggers a file operation, it is forwarded to the virtual filesystem, allowing the application to run fully within the browser without any native file system access. The /files/ mounting point also makes use of IndexedDB, a low-level browser API for storing structured data, which is what makes persistent, client-side read/write storage possible without a server-side component.
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
4 changes: 2 additions & 2 deletions sites/labs/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineCommonCollections } from "@leaningtech/astro-theme/content";
import { defineLabsCollections } from "@leaningtech/astro-theme/content";

export const collections = defineCommonCollections();
export const collections = defineLabsCollections();
Binary file removed sites/labs/src/content/showcase/boardspace.png
Diff not rendered.
Binary file removed sites/labs/src/content/showcase/cjdom.png
Diff not rendered.
Diff not rendered.
Binary file removed sites/labs/src/content/showcase/itext.png
Diff not rendered.
Loading
Loading