From 541ec8e5a5e8572f08e9d9e3f09b3b4b671d9c89 Mon Sep 17 00:00:00 2001 From: despiegk Date: Sun, 3 Aug 2025 09:42:56 +0200 Subject: [PATCH] ... --- src/App.jsx | 1 + src/content/tech/blockchain-identity.md | 3 +- src/content/tech/peer-to-peer-network.md | 3 +- src/content/tech/quantum-safe-storage.md | 3 +- .../tech/zero-knowledge-architecture.md | 3 +- src/pages/Technology.jsx | 80 ++++++------------- 6 files changed, 33 insertions(+), 60 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 094befd..514b53d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -25,6 +25,7 @@ function App() { } /> } /> } /> + } /> diff --git a/src/content/tech/blockchain-identity.md b/src/content/tech/blockchain-identity.md index 7b78ed8..802824c 100644 --- a/src/content/tech/blockchain-identity.md +++ b/src/content/tech/blockchain-identity.md @@ -6,7 +6,8 @@ readTime: "7 min read" image: "heartblue.jpg" description: "Cryptographically verified identity system built on blockchain technology. You control your reputation and trust relationships." tags: ["technology", "blockchain", "identity", "security"] - +iconname: "Key" +order: 4 slug: blockchain-identity --- diff --git a/src/content/tech/peer-to-peer-network.md b/src/content/tech/peer-to-peer-network.md index f6e3a36..e0421c9 100644 --- a/src/content/tech/peer-to-peer-network.md +++ b/src/content/tech/peer-to-peer-network.md @@ -6,7 +6,8 @@ readTime: "6 min read" image: "sphere.jpg" description: "Direct communication between HEROs without central servers. Built on distributed protocols that ensure privacy and resilience." tags: ["technology", "p2p", "network", "communication"] - +iconname: "Network" +order: 3 slug: peer-to-peer-network --- diff --git a/src/content/tech/quantum-safe-storage.md b/src/content/tech/quantum-safe-storage.md index d879c76..5be81e8 100644 --- a/src/content/tech/quantum-safe-storage.md +++ b/src/content/tech/quantum-safe-storage.md @@ -6,7 +6,8 @@ readTime: "8 min read" image: "swarm.jpg" description: "Post-quantum cryptography protects your data against future quantum computing threats. Memory is dispersed across multiple nodes with no single point of failure." tags: ["technology", "quantum-safe", "storage", "security"] - +iconname: "Database" +order: 2 slug: quantum-safe-storage --- diff --git a/src/content/tech/zero-knowledge-architecture.md b/src/content/tech/zero-knowledge-architecture.md index 8b926a6..ac3635f 100644 --- a/src/content/tech/zero-knowledge-architecture.md +++ b/src/content/tech/zero-knowledge-architecture.md @@ -6,7 +6,8 @@ readTime: "7 min read" image: "person.jpg" description: "Advanced cryptographic techniques ensure that even HERO cannot access your data. Your information is encrypted before it leaves your device." tags: ["technology", "zero-knowledge", "security"] - +iconname: "Shield" +order: 1 slug: zero-knowledge-architecture --- diff --git a/src/pages/Technology.jsx b/src/pages/Technology.jsx index de02c88..3602ec9 100644 --- a/src/pages/Technology.jsx +++ b/src/pages/Technology.jsx @@ -9,13 +9,13 @@ import matter from 'gray-matter'; // Import matter // Import images import techBackground from '../assets/herotech.jpg'; // HERO Technology background -import blockchainImage from '../assets/heartblue.jpg'; // Blockchain visualization -import networkImage from '../assets/sphere.jpg'; // sphere -import securityImage from '../assets/person.jpg'; // Digital privacy -import swarmImage from '../assets/swarm.jpg'; // AI Agent Creation -// Use Vite's import.meta.glob to import all tech markdown files -const techModules = import.meta.glob('../content/tech/*.md', { query: '?raw', import: 'default', eager: true }); +// Use Vite's import.meta.glob to import all tech markdown files and images +const techModules = import.meta.glob('../content/tech/*.md', { as: 'raw', eager: true }); +const imageModules = import.meta.glob('../assets/*.jpg', { eager: true, import: 'default' }); +const iconComponents = { Shield, Database, Network, Key, Cpu, Globe, Lock, Zap }; + +console.log('Tech Modules:', techModules); const Technology = () => { const [technologies, setTechnologies] = useState([]); @@ -30,27 +30,19 @@ const Technology = () => { const content = techModules[path]; const { data: frontmatter } = matter(content); - // Map icon strings to actual components - const iconMap = { - 'Shield': , - 'Database': , - 'Network': , - 'Key': - }; + const IconComponent = iconComponents[frontmatter.iconname]; + const imagePath = `../assets/${frontmatter.image}`; // Construct full path + const importedImage = imageModules[imagePath]; - // Map image paths to actual imports - const imageMap = { - '/src/assets/person.jpg': securityImage, - '/src/assets/swarm.jpg': swarmImage, - '/src/assets/sphere.jpg': networkImage, - '/src/assets/heartblue.jpg': blockchainImage - }; + console.log('Loading technology:', frontmatter.title); + console.log('IconComponent:', frontmatter.iconname, IconComponent); + console.log('ImagePath:', imagePath, 'ImportedImage:', importedImage); loadedTechnologies.push({ - icon: iconMap[frontmatter.icon] || , + icon: IconComponent ? : , title: frontmatter.title, description: frontmatter.description, - image: imageMap[frontmatter.image] || securityImage, + image: importedImage, order: frontmatter.order || 999, slug: frontmatter.slug || frontmatter.title.toLowerCase().replace(/\s+/g, '-') }); @@ -61,37 +53,9 @@ const Technology = () => { setTechnologies(loadedTechnologies); } catch (error) { console.error('Error loading technologies:', error); - // Fallback to static data if loading fails (optional, but good for robustness) - setTechnologies([ - { - icon: , - title: "Zero-Knowledge Architecture", - description: "Advanced cryptographic techniques ensure that even HERO cannot access your data. Your information is encrypted before it leaves your device.", - image: securityImage, - slug: "zero-knowledge-architecture" - }, - { - icon: , - title: "Quantum-Safe Storage", - description: "Post-quantum cryptography protects your data against future quantum computing threats. Memory is dispersed across multiple nodes with no single point of failure.", - image: swarmImage, - slug: "quantum-safe-storage" - }, - { - icon: , - title: "Peer-to-Peer Network", - description: "Direct communication between HEROs without central servers. Built on distributed protocols that ensure privacy and resilience.", - image: networkImage, - slug: "peer-to-peer-network" - }, - { - icon: , - title: "Blockchain Identity", - description: "Cryptographically verified identity system built on blockchain technology. You control your reputation and trust relationships.", - image: blockchainImage, - slug: "blockchain-identity" - } - ]); + setTechnologies([]); // Ensure technologies is empty on error + // Optionally, set an error state to display a message to the user + // setError('Failed to load technologies. Please try again later.'); } finally { setLoading(false); } @@ -223,9 +187,9 @@ const Technology = () => {
)) - ) : ( + ) : technologies.length > 0 ? ( technologies.map((spec, index) => ( - + { /> )) + ) : ( +
+ Failed to load technologies. Please check the console for errors. +
)} @@ -400,7 +368,7 @@ const Technology = () => { className="relative" > Security Architecture