diff --git a/src/components/head/ArticleStructuredData.astro b/src/components/head/ArticleStructuredData.astro
index 48aa5f2..f7adcce 100644
--- a/src/components/head/ArticleStructuredData.astro
+++ b/src/components/head/ArticleStructuredData.astro
@@ -1,43 +1,43 @@
----
-import config from "@/app/config.json"
-import { get } from "@/model/registry.js"
-import { default_image } from "@/app/config.js"
-
-const { frontmatter } = Astro.props
-const title = frontmatter?.title || config.site.title
-const pageUrl = new URL(Astro.url.pathname, Astro.site)
-const image = frontmatter ? frontmatter.image || default_image() : default_image()
-
-const itemData = frontmatter ? await get("json-ld", {} as any, frontmatter,
-{
- url: pageUrl.href,
-}) : null
-
-const meta = config.metadata || { }
-
-let data = itemData || {
- "@context": "https://schema.org",
- "@type": "Article",
- headline: title,
- description: frontmatter?.description || meta.description,
- //datePublished: createdAt?.toISOString(),
- //dateModified: updatedAt?.toISOString() ?? undefined,
- url: pageUrl,
- thumbnailUrl: image,
- image: {
- "@type": "ImageObject",
- url: image.src || "",
- caption: image.alt,
- width: image.width,
- height: image.height,
- },
- author: {
- "@type": "Person",
- name: meta.author,
- description: meta.author_bio,
- url: meta.author_url
- }
-}
----
-
-
+---
+import config from "@/app/config.json"
+import { get } from "@/model/registry.js"
+import { default_image } from "@/app/config.js"
+
+const { frontmatter } = Astro.props
+const title = frontmatter?.title || config.site.title
+const pageUrl = new URL(Astro.url.pathname, Astro.site)
+const image = frontmatter ? frontmatter.image || default_image() : default_image()
+
+const itemData = frontmatter ? await get("json-ld", {} as any, frontmatter,
+{
+ url: pageUrl.href,
+}) : null
+
+const meta = config.metadata || { }
+
+let data = itemData || {
+ "@context": "https://schema.org",
+ "@type": "Article",
+ headline: title,
+ description: frontmatter?.description || meta.description,
+ //datePublished: createdAt?.toISOString(),
+ //dateModified: updatedAt?.toISOString() ?? undefined,
+ url: pageUrl,
+ thumbnailUrl: image,
+ image: {
+ "@type": "ImageObject",
+ url: image.src || "",
+ caption: image.alt,
+ width: image.width,
+ height: image.height,
+ },
+ author: {
+ "@type": "Person",
+ name: meta.author,
+ description: meta.author_bio,
+ url: meta.author_url
+ }
+}
+---
+
+
diff --git a/src/components/polymech/Gallery.astro b/src/components/polymech/Gallery.astro
index 17a1afe..ead2a26 100644
--- a/src/components/polymech/Gallery.astro
+++ b/src/components/polymech/Gallery.astro
@@ -43,9 +43,7 @@ const mergedLightboxSettings = {
SHOW_DESCRIPTION: lightboxSettings.SHOW_DESCRIPTION ?? IMAGE_SETTINGS.LIGHTBOX.SHOW_DESCRIPTION,
};
const locale = Astro.currentLocale || "en";
-
---
-
+ }"class="product-gallery">
+
{images.map((image, index) => (
@@ -88,8 +86,12 @@ const locale = Astro.currentLocale || "en";
objectFit="contain"
format="avif"
placeholder="blurred"
- sizes={mergedGallerySettings.SIZES_REGULAR}
- class="rounded max-h-full object-contain main-image"
+ breakpoints={[200,300,500]}
+ fadeInTransition={{
+ delay: "0.5s",
+ duration: "2.5s",
+ timingFunction: "linear",
+ }}
attributes={{
img: { class: "main-image rounded-lg max-h-[60vh] aspect-square" }
}}
diff --git a/src/components/polymech/Gallery.md b/src/components/polymech/Gallery.md
index fd8d90a..4f25ac2 100644
--- a/src/components/polymech/Gallery.md
+++ b/src/components/polymech/Gallery.md
@@ -1 +1 @@
-- [ ] integrate new feature : let me swipe "Main Image", without react, using Alpine.js
+- [ ] integrate new feature : let me swipe "Main Image", without react, using Alpine.js
diff --git a/src/components/polymech/GalleryK.astro b/src/components/polymech/GalleryK.astro
index 0103828..62d6c3e 100644
--- a/src/components/polymech/GalleryK.astro
+++ b/src/components/polymech/GalleryK.astro
@@ -113,10 +113,9 @@ const ld = await toJsonLd(images, Astro.currentLocale || I18N_SOURCE_LANGUAGE, c
this.lightboxLoaded = false;
let img = new Image();
img.src = this.images[this.currentIndex].src;
- img.onload = () => {
- this.lightboxLoaded = true;
- this.open = true;
- };
+ this.lightboxLoaded = true;
+ this.open = true;
+ img.onload = () => { };
}
}
`}
@@ -152,8 +151,8 @@ const ld = await toJsonLd(images, Astro.currentLocale || I18N_SOURCE_LANGUAGE, c
alt={alt_translated[index]}
objectFit="contain"
format="avif"
- placeholder="blurred"
sizes={mergedGallerySettings.SIZES_REGULAR}
+ loading="lazy"
attributes={{
img: { class: "main-image p-1 rounded-lg max-h-[60vh] aspect-square" }
}}
@@ -172,34 +171,37 @@ const ld = await toJsonLd(images, Astro.currentLocale || I18N_SOURCE_LANGUAGE, c
))}
)}
-
-
❯
-
-
+
\ No newline at end of file
diff --git a/src/components/polymech/conditional.astro b/src/components/polymech/conditional.astro
index ae83578..eb2af1c 100644
--- a/src/components/polymech/conditional.astro
+++ b/src/components/polymech/conditional.astro
@@ -1,8 +1,8 @@
----
-import DefaultFallback from "@/components/Default.astro"
-const { expression = false, fallback = DefaultFallback } = Astro.props
-const currentLocal = Astro.currentLocale || "en"
----
-
+---
+import DefaultFallback from "@/components/Default.astro"
+const { expression = false, fallback = DefaultFallback } = Astro.props
+const currentLocal = Astro.currentLocale || "en"
+---
+
diff --git a/src/components/polymech/i18n.astro b/src/components/polymech/i18n.astro
index 672716f..80eebfc 100644
--- a/src/components/polymech/i18n.astro
+++ b/src/components/polymech/i18n.astro
@@ -1,21 +1,22 @@
----
-import { I18N_SOURCE_LANGUAGE } from "config/config.js"
-import { translate, IOptions } from '@/base/i18n.js'
-
-export interface Props extends IOptions {
- language?: string,
- clazz?:string
-}
-
-const {
- language = Astro.currentLocale,
- clazz = '',
- ...rest
-} = Astro.props
-
-const content = await Astro.slots.render('default')
-const translatedText = await translate(content, I18N_SOURCE_LANGUAGE, language, rest)
----
-
- {translatedText}
-
+---
+import { I18N_SOURCE_LANGUAGE } from "config/config.js"
+import { translate, IOptions } from '@/base/i18n.js'
+
+export interface Props extends IOptions {
+ language?: string,
+ clazz?:string
+}
+
+const {
+ language = Astro.currentLocale,
+ clazz = '',
+ ...rest
+} = Astro.props
+
+const content = await Astro.slots.render('default')
+const translatedText = await translate(content, I18N_SOURCE_LANGUAGE, language, rest)
+
+---
+
+ {translatedText}
+
diff --git a/src/components/polymech/image.astro b/src/components/polymech/image.astro
index e7d10df..1649622 100644
--- a/src/components/polymech/image.astro
+++ b/src/components/polymech/image.astro
@@ -1,22 +1,22 @@
----
-import { DEFAULT_IMAGE_URL } from '@/app/config.js'
-import { Picture } from "imagetools/components"
-import { image_url } from "@/base/media.js"
-
-interface SafeImageProps {
- src: string
- alt: string
- fallback?: string
- [propName: string]: any
-}
-
-const {
- src,
- alt,
- fallback = DEFAULT_IMAGE_URL,
- ...rest
-} = Astro.props as SafeImageProps
-
-const srcSafe = await image_url(src, fallback)
----
-
+---
+import { DEFAULT_IMAGE_URL } from '@/app/config.js'
+import { Picture } from "imagetools/components"
+import { image_url } from "@/base/media.js"
+
+interface SafeImageProps {
+ src: string
+ alt: string
+ fallback?: string
+ [propName: string]: any
+}
+
+const {
+ src,
+ alt,
+ fallback = DEFAULT_IMAGE_URL,
+ ...rest
+} = Astro.props as SafeImageProps
+
+const srcSafe = await image_url(src, fallback)
+---
+
diff --git a/src/components/polymech/jsx.astro b/src/components/polymech/jsx.astro
index 85a0ad6..71a70b5 100644
--- a/src/components/polymech/jsx.astro
+++ b/src/components/polymech/jsx.astro
@@ -1,7 +1,7 @@
----
-import JsxParser from 'react-jsx-parser'
-const {...rest} = Astro.props
----
-
+---
+import JsxParser from 'react-jsx-parser'
+const {...rest} = Astro.props
+---
+
diff --git a/src/components/polymech/kbot.astro b/src/components/polymech/kbot.astro
index 1d5686d..7483728 100644
--- a/src/components/polymech/kbot.astro
+++ b/src/components/polymech/kbot.astro
@@ -1,103 +1,103 @@
----
-import JSX from "./jsx.astro"
-import { sync as read } from "@polymech/fs/read"
-import { sync as exists } from "@polymech/fs/exists"
-import {} from "@polymech/cache"
-
-import { run, OptionsSchema, IKBotTask } from "@polymech/kbot-d";
-import { render } from "@/base";
-import { renderMarkup } from "@/model/component.js";
-
-const { ...rest } = Astro.props;
-const promptContent = ((await Astro.slots.render("default")) as string) || "";
-
-export interface Props extends IKBotTask {
- language?: string;
- clazz?: string;
- cache?: boolean;
- disabled?: boolean;
- template?: string;
- renderer?: string;
-}
-
-export const template_simple = () => {
- return {
- router: "openai",
- model: "gpt-4o",
- preferences: "none",
- mode: "completion",
- };
-}
-
-export const template_code_simple = () => {
- return {
- preferences: "none",
- mode: "completion",
- };
-}
-
-export const template_research = () => {
- return {
- router: "openai",
- model: "gpt-4.5-preview",
- preferences: "none",
- mode: "completion",
- }
-}
-
-export const templates = {
- simple: template_simple,
- code_simple: template_code_simple,
- research: template_research,
-}
-
-const template = templates[rest.template || "simple"]
-const options = OptionsSchema().parse({
- prompt: promptContent,
- ...template(),
- ...rest,
-} as Props);
-
-let result: string | unknown[] = [];
-if (options.cache && exists(options.dst) && !options.disabled) {
- result = [read(options.dst)];
-} else {
- if (options.disabled) {
- result = ["
Disabled
"];
- } else {
- result = await run(options);
- }
-}
-let Content;
-const renderers = {
- jsx: async (content: string) => {},
- html: async (content: string) => {},
- md: async (str: string) => {
- const markup = (await renderMarkup(str, options, "test.md")) || { html: "failed md" }
- const ret = await render(markup.html)
- return ret
- },
- astro: async (content: string) => {
- // const compiled = await compile(content)
- // const moduleUrl = `data:text/javascript;charset=utf-8,${encodeURIComponent(compiled)}`
- // const module = await import(moduleUrl)
- // return module.default
- },
-};
-const content = result[0];
-const renderType = rest.renderer || "md";
-const renderer = renderers[renderType];
-
-Content = await renderer(content)
----
-
-
- {
- !rest.disabled && renderType === "md" ? (
) : (
Failed to render MD : {content.substr(0,100)}
)
- }
- {
- !rest.disabled && (renderType === "jsx" || renderType === "html") && (
-
- )
- }
-
+---
+import JSX from "./jsx.astro"
+import { sync as read } from "@polymech/fs/read"
+import { sync as exists } from "@polymech/fs/exists"
+import {} from "@polymech/cache"
+
+import { run, OptionsSchema, IKBotTask } from "@polymech/kbot-d";
+import { render } from "@/base";
+import { renderMarkup } from "@/model/component.js";
+
+const { ...rest } = Astro.props;
+const promptContent = ((await Astro.slots.render("default")) as string) || "";
+
+export interface Props extends IKBotTask {
+ language?: string;
+ clazz?: string;
+ cache?: boolean;
+ disabled?: boolean;
+ template?: string;
+ renderer?: string;
+}
+
+export const template_simple = () => {
+ return {
+ router: "openai",
+ model: "gpt-4o",
+ preferences: "none",
+ mode: "completion",
+ };
+}
+
+export const template_code_simple = () => {
+ return {
+ preferences: "none",
+ mode: "completion",
+ };
+}
+
+export const template_research = () => {
+ return {
+ router: "openai",
+ model: "gpt-4.5-preview",
+ preferences: "none",
+ mode: "completion",
+ }
+}
+
+export const templates = {
+ simple: template_simple,
+ code_simple: template_code_simple,
+ research: template_research,
+}
+
+const template = templates[rest.template || "simple"]
+const options = OptionsSchema().parse({
+ prompt: promptContent,
+ ...template(),
+ ...rest,
+} as Props);
+
+let result: string | unknown[] = [];
+if (options.cache && exists(options.dst) && !options.disabled) {
+ result = [read(options.dst)];
+} else {
+ if (options.disabled) {
+ result = ["
Disabled
"];
+ } else {
+ result = await run(options);
+ }
+}
+let Content;
+const renderers = {
+ jsx: async (content: string) => {},
+ html: async (content: string) => {},
+ md: async (str: string) => {
+ const markup = (await renderMarkup(str, options, "test.md")) || { html: "failed md" }
+ const ret = await render(markup.html)
+ return ret
+ },
+ astro: async (content: string) => {
+ // const compiled = await compile(content)
+ // const moduleUrl = `data:text/javascript;charset=utf-8,${encodeURIComponent(compiled)}`
+ // const module = await import(moduleUrl)
+ // return module.default
+ },
+};
+const content = result[0];
+const renderType = rest.renderer || "md";
+const renderer = renderers[renderType];
+
+Content = await renderer(content)
+---
+
+
+ {
+ !rest.disabled && renderType === "md" ? (
) : (
Failed to render MD : {content.substr(0,100)}
)
+ }
+ {
+ !rest.disabled && (renderType === "jsx" || renderType === "html") && (
+
+ )
+ }
+
diff --git a/src/components/polymech/map-ex.md b/src/components/polymech/map-ex.md
index c0eba47..b67de3b 100644
--- a/src/components/polymech/map-ex.md
+++ b/src/components/polymech/map-ex.md
@@ -1,70 +1,70 @@
-# map.astro Component Documentation
-
-## Overview
-`map.astro` is an Astro component that renders a Google Maps static map displaying multiple locations with markers. The component centers the map based on the average coordinates of all locations.
-
-## Component Structure
-- **File Location**: `C:\Users\zx\Desktop\polymech\polymech-site\src\components\polymech\map.astro`
-- **Dependencies**: Imports types from `map-types.ts`
-
-## Props
-The component accepts the following props:
-
-### `locations` (optional)
-An array of location objects with the following structure:
-```typescript
-interface Location {
- geo: {
- lat: number; // Latitude
- lon: number; // Longitude
- };
- title: string; // Location title/name
-}
-```
-
-If not provided, it defaults to sample locations in Lamu, Kenya.
-
-### `options` (optional)
-Configuration options for the map:
-```typescript
-interface Options {
- zoom?: number; // Map zoom level (default: 9)
- api_key?: string; // Google Maps API key (required for map to display)
-}
-```
-
-## Features
-1. **Automatic Map Centering**: Calculates the average of all location coordinates to center the map
-2. **Labeled Markers**: Adds alphabetical labels (A, B, C, etc.) to each marker
-3. **Location Legend**: Displays a list of locations with corresponding marker labels
-4. **Error Handling**: Shows an error message when no API key is provided
-
-## Example Usage
-```astro
----
-import Map from '../components/polymech/map.astro';
----
-
-
-```
-
-## Notes
-- **API Key Required**: A Google Maps API key is necessary for the map to function
-- **Responsive Design**: The map container uses responsive classes for proper display on various screen sizes
-- **Style Customization**: The component includes a style tag for additional CSS customization
-
+# map.astro Component Documentation
+
+## Overview
+`map.astro` is an Astro component that renders a Google Maps static map displaying multiple locations with markers. The component centers the map based on the average coordinates of all locations.
+
+## Component Structure
+- **File Location**: `C:\Users\zx\Desktop\polymech\polymech-site\src\components\polymech\map.astro`
+- **Dependencies**: Imports types from `map-types.ts`
+
+## Props
+The component accepts the following props:
+
+### `locations` (optional)
+An array of location objects with the following structure:
+```typescript
+interface Location {
+ geo: {
+ lat: number; // Latitude
+ lon: number; // Longitude
+ };
+ title: string; // Location title/name
+}
+```
+
+If not provided, it defaults to sample locations in Lamu, Kenya.
+
+### `options` (optional)
+Configuration options for the map:
+```typescript
+interface Options {
+ zoom?: number; // Map zoom level (default: 9)
+ api_key?: string; // Google Maps API key (required for map to display)
+}
+```
+
+## Features
+1. **Automatic Map Centering**: Calculates the average of all location coordinates to center the map
+2. **Labeled Markers**: Adds alphabetical labels (A, B, C, etc.) to each marker
+3. **Location Legend**: Displays a list of locations with corresponding marker labels
+4. **Error Handling**: Shows an error message when no API key is provided
+
+## Example Usage
+```astro
+---
+import Map from '../components/polymech/map.astro';
+---
+
+
+```
+
+## Notes
+- **API Key Required**: A Google Maps API key is necessary for the map to function
+- **Responsive Design**: The map container uses responsive classes for proper display on various screen sizes
+- **Style Customization**: The component includes a style tag for additional CSS customization
+
diff --git a/src/components/polymech/map-types.ts b/src/components/polymech/map-types.ts
index 83f4f6b..c2430e6 100644
--- a/src/components/polymech/map-types.ts
+++ b/src/components/polymech/map-types.ts
@@ -1,19 +1,19 @@
-export interface GeoPos {
- lon: number;
- lat: number;
-}
-
-export interface Location {
- geo: GeoPos;
- title: string;
- group?: string;
- website?: string;
-}
-
-export interface Options {
- zoom?: number;
- api_key?: string;
- width?: number;
- height?: number;
- fitToBounds?: boolean;
-}
+export interface GeoPos {
+ lon: number;
+ lat: number;
+}
+
+export interface Location {
+ geo: GeoPos;
+ title: string;
+ group?: string;
+ website?: string;
+}
+
+export interface Options {
+ zoom?: number;
+ api_key?: string;
+ width?: number;
+ height?: number;
+ fitToBounds?: boolean;
+}
diff --git a/src/components/polymech/remote.astro b/src/components/polymech/remote.astro
index ff16be5..8c66509 100644
--- a/src/components/polymech/remote.astro
+++ b/src/components/polymech/remote.astro
@@ -1,11 +1,11 @@
----
-// Example: Fetch Markdown from a remote API
-// and render it to HTML, at runtime.
-// Using "marked" (https://github.com/markedjs/marked)
-import { marked } from 'marked'
-const {...rest} = Astro.props
-const response = await fetch(rest.src || 'https://raw.githubusercontent.com/wiki/adam-p/markdown-here/Markdown-Cheatsheet.md')
-const markdown = await response.text();
-const content = marked.parse(markdown);
----
+---
+// Example: Fetch Markdown from a remote API
+// and render it to HTML, at runtime.
+// Using "marked" (https://github.com/markedjs/marked)
+import { marked } from 'marked'
+const {...rest} = Astro.props
+const response = await fetch(rest.src || 'https://raw.githubusercontent.com/wiki/adam-p/markdown-here/Markdown-Cheatsheet.md')
+const markdown = await response.text();
+const content = marked.parse(markdown);
+---
\ No newline at end of file
diff --git a/src/components/polymech/renderer.ts b/src/components/polymech/renderer.ts
index 172ae99..7a5bae1 100644
--- a/src/components/polymech/renderer.ts
+++ b/src/components/polymech/renderer.ts
@@ -1,53 +1,53 @@
-import { unified } from "unified"
-import remarkParse from "remark-parse"
-import remarkGfm from "remark-gfm"
-import remarkRehype from "remark-rehype"
-import rehypeRaw from "rehype-raw"
-import emoji from "remark-emoji"
-import rehypeStringify from "rehype-stringify"
-import { createComponent } from "astro/runtime/server/astro-component.js"
-import { renderTemplate, unescapeHTML } from "astro/runtime/server/index.js"
-
-// Define the type for the component map
-type ComponentMap = Record
) => unknown>;
-
-// Function to convert Markdown to HTML and replace elements with Astro components
-export async function markdown(input: string, componentsMap: ComponentMap = {}): Promise {
- const slots: unknown[] = [];
- let slotIndex = 0;
-
- // Ensure input is treated as UTF-8
- const markdownText = new TextDecoder("utf-8").decode(new TextEncoder().encode(input));
-
- const processedHtml = await unified()
- .use(remarkParse) // Parse Markdown to AST
- .use(emoji, {
- accessible: true, // Defaults to false
- emoticon: true, // Defaults to false
- })
- .use(remarkGfm) // Enable tables, strikethrough, autolinks, etc.
- .use(remarkRehype, { allowDangerousHtml: true }) // Convert Markdown to HTML AST
- .use(rehypeRaw) // Process raw HTML inside Markdown
- .use(() => (tree) => {
- function transformNode(node: { type: string; tagName?: string; properties?: Record; value?: string; children?: any[] }) {
- if (node.type === "element" && node.tagName && componentsMap[node.tagName]) {
- const props = node.properties || {};
-
- // Register the component as a slot instead of calling it directly
- const slotName = `COMPONENT_SLOT_${slotIndex++}`;
- slots[slotName] = { component: componentsMap[node.tagName], props };
- node.type = "text";
- node.value = ``; // Slot placeholder
- }
-
- if (node.children) {
- node.children.forEach(transformNode);
- }
- }
- transformNode(tree);
- })
- .use(rehypeStringify) // Convert AST back to HTML
- .process(markdownText);
-
- return createComponent(() => renderTemplate(unescapeHTML(processedHtml.toString()), slots));
-}
+import { unified } from "unified"
+import remarkParse from "remark-parse"
+import remarkGfm from "remark-gfm"
+import remarkRehype from "remark-rehype"
+import rehypeRaw from "rehype-raw"
+import emoji from "remark-emoji"
+import rehypeStringify from "rehype-stringify"
+import { createComponent } from "astro/runtime/server/astro-component.js"
+import { renderTemplate, unescapeHTML } from "astro/runtime/server/index.js"
+
+// Define the type for the component map
+type ComponentMap = Record) => unknown>;
+
+// Function to convert Markdown to HTML and replace elements with Astro components
+export async function markdown(input: string, componentsMap: ComponentMap = {}): Promise {
+ const slots: unknown[] = [];
+ let slotIndex = 0;
+
+ // Ensure input is treated as UTF-8
+ const markdownText = new TextDecoder("utf-8").decode(new TextEncoder().encode(input));
+
+ const processedHtml = await unified()
+ .use(remarkParse) // Parse Markdown to AST
+ .use(emoji, {
+ accessible: true, // Defaults to false
+ emoticon: true, // Defaults to false
+ })
+ .use(remarkGfm) // Enable tables, strikethrough, autolinks, etc.
+ .use(remarkRehype, { allowDangerousHtml: true }) // Convert Markdown to HTML AST
+ .use(rehypeRaw) // Process raw HTML inside Markdown
+ .use(() => (tree) => {
+ function transformNode(node: { type: string; tagName?: string; properties?: Record; value?: string; children?: any[] }) {
+ if (node.type === "element" && node.tagName && componentsMap[node.tagName]) {
+ const props = node.properties || {};
+
+ // Register the component as a slot instead of calling it directly
+ const slotName = `COMPONENT_SLOT_${slotIndex++}`;
+ slots[slotName] = { component: componentsMap[node.tagName], props };
+ node.type = "text";
+ node.value = ``; // Slot placeholder
+ }
+
+ if (node.children) {
+ node.children.forEach(transformNode);
+ }
+ }
+ transformNode(tree);
+ })
+ .use(rehypeStringify) // Convert AST back to HTML
+ .process(markdownText);
+
+ return createComponent(() => renderTemplate(unescapeHTML(processedHtml.toString()), slots));
+}
diff --git a/src/components/polymech/resources.astro b/src/components/polymech/resources.astro
index 191015f..6d1fdb7 100644
--- a/src/components/polymech/resources.astro
+++ b/src/components/polymech/resources.astro
@@ -1,19 +1,19 @@
---
-import { component, createMarkdownComponent } from "@/base/index.js";
+import { createMarkdownComponent } from "@/base/index.js";
import Translation from "@/components/polymech/i18n.astro";
import Link from "./link.astro";
-const { frontmatter: data, ...rest } = Astro.props;
+const { frontmatter: data } = Astro.props;
const LINK_CLASSES = "text-blue-400 hover:text-blue-800 hover:underline";
const getHref = (key, data) => {
switch (key) {
case "cad":
- return data.cad?.[0]?.[".html"];
+ return data.cad?.[0]?.[".html"]
default:
- return data[key];
+ return data[key]
}
-};
+}
const checkCondition = (key, data) => {
switch (key) {
@@ -74,11 +74,11 @@ const filteredGroups: Record<
return acc;
}, {});
-const extraContent = [data.extra_resources, data.tests]
+const extraContent = [data.resources, data.tests]
.filter((s) => s && s.length)
.map(createMarkdownComponent)
-const sharedContent = [data.shared_resources]
+const sharedContent = [data.shared]
.filter((s) => s && s.length)
.map(createMarkdownComponent)
---
@@ -89,10 +89,10 @@ const sharedContent = [data.shared_resources]
{
Object.entries(filteredGroups).map(([name, links]) => (
-
+
{name}
-
+
{links.map((link) => (
{link.label}
@@ -105,7 +105,7 @@ const sharedContent = [data.shared_resources]
{
extraContent.length > 0 && (
-
+
Extras
@@ -119,7 +119,7 @@ const sharedContent = [data.shared_resources]
}
{
sharedContent.length > 0 && (
-