Skip to content

Commit c33156c

Browse files
committed
update idea cards app
1 parent 6020a7e commit c33156c

12 files changed

Lines changed: 1272 additions & 11 deletions

Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Project Structure & Module Organization
44
- `index.html` is the entry point; it loads the responsive card grid and modal logic.
55
- `src/` holds modular scripts (`src/cards.js`, `src/modal.js`) and shared utilities.
6-
- `data/cards.json` stores card metadata (`id`, `title`, `summary`, `details`, `tags`).
6+
- `../data/cards.md` stores card metadata (`title`, `summary`, `details`, `tags`).
77
- `assets/styles/` contains compiled CSS; author SCSS in `assets/styles/scss/`.
88
- `assets/images/` keeps optimized `.webp` thumbnails referenced by card entries.
99
- `docs/` mirrors the production-ready bundle pushed to GitHub Pages (built from `dist/`).
@@ -33,6 +33,6 @@
3333
- Ensure `npm run lint` and relevant tests pass; update `docs/` from the latest `dist/` before merging.
3434

3535
## Content Workflow
36-
- Add new cards via `data/cards.json`, keeping body text Markdown-friendly for future parsing.
36+
- Add new cards via `../data/cards.md`, keeping body text Markdown-friendly for future parsing.
3737
- Store supporting assets under `assets/images/` and reference them in the card entry.
3838
- Validate copy for accessibility (clear titles, concise summaries) and include `alt` text for every image.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build && cpy data dist/data --recursive",
8+
"build": "vite build && rimraf dist/data && cpy ../data dist --recursive",
99
"preview": "vite preview",
1010
"lint": "npm run lint:js && npm run lint:css && npm run lint:format",
1111
"lint:js": "eslint \"src/**/*.{js,jsx}\" \"tests/**/*.js\" --max-warnings=0",

app/src/cards.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let cardsCache = null;
44

55
const cardsRequestUrl = (() => {
66
try {
7-
return new URL('../data/cards.md', import.meta.url).href;
7+
return new URL('../../data/cards.md', import.meta.url).href;
88
} catch (error) {
99
console.warn('Unable to resolve cards.md via import.meta.url, falling back to relative path', error);
1010
return 'data/cards.md';
@@ -292,8 +292,12 @@ function loadFromBundle() {
292292
}
293293

294294
try {
295-
const modules = import.meta.glob('../data/cards.md', { eager: true, as: 'raw' });
296-
const module = modules['../data/cards.md'];
295+
const modules = import.meta.glob('../../data/cards.md', {
296+
eager: true,
297+
import: 'default',
298+
query: '?raw',
299+
});
300+
const module = modules['../../data/cards.md'];
297301
if (!module) {
298302
return null;
299303
}

app/vite.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { defineConfig } from 'vite';
22
import { resolve } from 'node:path';
3+
4+
const workspaceRoot = resolve(__dirname, '..');
5+
36
export default defineConfig({
47
root: '.',
58
base: './',
@@ -10,6 +13,9 @@ export default defineConfig({
1013
},
1114
server: {
1215
open: true,
16+
fs: {
17+
allow: [workspaceRoot, __dirname],
18+
},
1319
},
1420
preview: {
1521
open: true,
File renamed without changes.

0 commit comments

Comments
 (0)