mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: data-driven tools
This commit is contained in:
1 parent
58b5ee7f83
commit
84dc5e4960
14 files changed
+118
-135
No files matched your search
@@ -1,15 +1,15 @@
|
||||
---
|
||||
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
||||
import { compareTool } from '../../../constants/tools';
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
import ToolOpenGraph from "../../../components/ToolOpenGraph.astro";
|
||||
import { tools } from "../../../constants/tools";
|
||||
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
---
|
||||
|
||||
<ToolOpenGraph tool={compareTool} />
|
||||
<ToolOpenGraph tool={tools.compare} />
|
||||
|
||||
<BaseLayout noFooter>
|
||||
<Page {locale} client:load />
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
import { embedTool } from '../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
import { tools } from "../../../constants/tools";
|
||||
import ToolLayout from "../../../layouts/ToolLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
---
|
||||
|
||||
<ToolLayout tool={embedTool}>
|
||||
<ToolLayout tool={tools.embed}>
|
||||
<Page {locale} />
|
||||
</ToolLayout>
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
import { galleryTool } from '../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import type { getStaticPaths } from '../index.astro';
|
||||
import { Page } from './_index';
|
||||
import { tools } from "../../../constants/tools";
|
||||
import ToolLayout from "../../../layouts/ToolLayout.astro";
|
||||
import type { getStaticPaths } from "../index.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
---
|
||||
|
||||
<ToolLayout tool={galleryTool}>
|
||||
<ToolLayout tool={tools.gallery}>
|
||||
<Page {locale} client:only="react">
|
||||
<Page {locale} skeleton slot="fallback" />
|
||||
</Page>
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AesonPlug } from "../../components/AesonPlug";
|
||||
import HomeHero from "../../components/HomeHero.astro";
|
||||
import { Plugs } from "../../components/Plugs";
|
||||
import ToolCard from "../../components/ToolCard.astro";
|
||||
import { TOOLS, type Tool } from "../../constants/tools";
|
||||
import { tools, type Tool } from "../../constants/tools";
|
||||
import { getStrings } from "../../core/i18n/getStrings";
|
||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||
|
||||
@@ -20,11 +20,15 @@ const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
const strings = getStrings(Astro.params.locale);
|
||||
const rows: Tool[][] = [];
|
||||
|
||||
for (const tool of TOOLS) {
|
||||
if (tool.disabled) continue;
|
||||
for (const id in tools) {
|
||||
const tool = tools[id];
|
||||
|
||||
if ("disabled" in tool && tool.disabled) continue;
|
||||
|
||||
const compatibleRow = rows.find(
|
||||
(row) => row.length < MAX_TOOLS_PER_ROW && !row[0].significant
|
||||
(row) =>
|
||||
row.length < MAX_TOOLS_PER_ROW &&
|
||||
!("significant" in row[0] && row[0].significant)
|
||||
);
|
||||
|
||||
if (compatibleRow) {
|
||||
@@ -109,11 +113,12 @@ export const getStaticPaths = (() => {
|
||||
rows.map((row) => (
|
||||
<Flex gap="4" direction={{ initial: "column", sm: "row" }}>
|
||||
{row.map((tool) => (
|
||||
<ToolCard tool={tool} />
|
||||
<ToolCard {tool} />
|
||||
))}
|
||||
{row.length < MAX_TOOLS_PER_ROW && !row[0].significant && (
|
||||
<Box flexGrow="1" />
|
||||
)}
|
||||
{row.length < MAX_TOOLS_PER_ROW &&
|
||||
!("significant" in row[0] && row[0].significant) && (
|
||||
<Box flexGrow="1" />
|
||||
)}
|
||||
</Flex>
|
||||
))
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
|
||||
import { performanceTool } from '../../../constants/tools';
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||
import type { getStaticPaths } from '../index.astro';
|
||||
import { Page } from './_index';
|
||||
import ToolOpenGraph from "../../../components/ToolOpenGraph.astro";
|
||||
import { tools } from "../../../constants/tools";
|
||||
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||
import type { getStaticPaths } from "../index.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
---
|
||||
|
||||
<ToolOpenGraph tool={performanceTool} />
|
||||
<ToolOpenGraph tool={tools.performance} />
|
||||
|
||||
<BaseLayout noFooter>
|
||||
<Page client:only="react" {locale}>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
---
|
||||
import { sessionTool } from '../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import type { getStaticPaths } from '../index.astro';
|
||||
import { Page } from './_index';
|
||||
import { tools } from "../../../constants/tools";
|
||||
import ToolLayout from "../../../layouts/ToolLayout.astro";
|
||||
import type { getStaticPaths } from "../index.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
---
|
||||
|
||||
<ToolLayout tool={sessionTool}>
|
||||
<ToolLayout tool={tools.session}>
|
||||
<Page client:load {locale} />
|
||||
</ToolLayout>
|
||||
@@ -1,14 +1,14 @@
|
||||
---
|
||||
import { tankopediaTool } from '../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
import { tools } from "../../../constants/tools";
|
||||
import ToolLayout from "../../../layouts/ToolLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
---
|
||||
|
||||
<ToolLayout tool={tankopediaTool}>
|
||||
<ToolLayout tool={tools.tanks}>
|
||||
<Page {locale} client:only="react">
|
||||
<Page {locale} skeleton slot="fallback" />
|
||||
</Page>
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
---
|
||||
import { tierListTool } from '../../../constants/tools';
|
||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
import { tools } from "../../../constants/tools";
|
||||
import ToolLayout from "../../../layouts/ToolLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
const { locale } = Astro.params;
|
||||
|
||||
|
||||
---
|
||||
|
||||
<ToolLayout tool={tierListTool}>
|
||||
<ToolLayout tool={tools.tier_list}>
|
||||
<Page {locale} client:load />
|
||||
</ToolLayout>
|
||||
Reference in new issue
Block a user