diff --git a/src/App.jsx b/src/App.jsx index 22d1aee..094befd 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -23,11 +23,8 @@ function App() { } /> } /> } /> - } /> - } /> + } /> } /> - } /> - } /> diff --git a/src/blogs/ai-that-serves-you-the-personal-agent-revolution.md b/src/content/blog/ai-that-serves-you-the-personal-agent-revolution.md similarity index 86% rename from src/blogs/ai-that-serves-you-the-personal-agent-revolution.md rename to src/content/blog/ai-that-serves-you-the-personal-agent-revolution.md index bd13e08..6bb1e50 100644 --- a/src/blogs/ai-that-serves-you-the-personal-agent-revolution.md +++ b/src/content/blog/ai-that-serves-you-the-personal-agent-revolution.md @@ -4,11 +4,11 @@ author: "HERO Team" date: "December 8, 2024" readTime: "7 min read" tags: ["AI", "Personal Agents", "Technology"] -image: "/src/assets/heart.jpg" +image: "heart.jpg" description: "Unlike corporate AI that serves shareholders, Personal Agents work exclusively for you. Learn how this changes everything about AI interaction." featured: false draft: false -cat: "blog" + slug: "ai-that-serves-you-the-personal-agent-revolution" --- diff --git a/src/blogs/building-trust-in-a-zero-knowledge-world.md b/src/content/blog/building-trust-in-a-zero-knowledge-world.md similarity index 86% rename from src/blogs/building-trust-in-a-zero-knowledge-world.md rename to src/content/blog/building-trust-in-a-zero-knowledge-world.md index 2c145b5..d964383 100644 --- a/src/blogs/building-trust-in-a-zero-knowledge-world.md +++ b/src/content/blog/building-trust-in-a-zero-knowledge-world.md @@ -4,11 +4,11 @@ author: "Dr. Sarah Chen" date: "December 12, 2024" readTime: "6 min read" tags: ["Cryptography", "Zero-Knowledge", "Security"] -image: "/src/assets/balls.jpg" +image: "balls.jpg" description: "How HERO's zero-knowledge architecture enables trust without compromising privacy. A deep dive into the cryptographic foundations of digital sovereignty." featured: false draft: false -cat: "blog" + slug: "building-trust-in-a-zero-knowledge-world" --- diff --git a/src/blogs/capability_communicate.md b/src/content/blog/communicate.md similarity index 92% rename from src/blogs/capability_communicate.md rename to src/content/blog/communicate.md index 3c66b36..d8a9453 100644 --- a/src/blogs/capability_communicate.md +++ b/src/content/blog/communicate.md @@ -2,8 +2,8 @@ title: "Communicate" description: "Secure messaging, voice, and video chat — all managed privately by your Personal Agent" icon: "Brain" -image: "/src/assets/communicate.jpg" -cat: "capability" +image: "communicate.jpg" + order: 1 slug: "communicate" --- diff --git a/src/blogs/capability_create.md b/src/content/blog/create.md similarity index 94% rename from src/blogs/capability_create.md rename to src/content/blog/create.md index 7c6502e..d1212c2 100644 --- a/src/blogs/capability_create.md +++ b/src/content/blog/create.md @@ -2,8 +2,8 @@ title: "Create" description: "Build documents, videos, and creative assets collaboratively with AI assistance" icon: "Zap" -image: "/src/assets/heart.jpg" -cat: "capability" +image: "heart.jpg" + order: 2 slug: "create" --- diff --git a/src/blogs/capability_develop.md b/src/content/blog/develop.md similarity index 94% rename from src/blogs/capability_develop.md rename to src/content/blog/develop.md index fca86d6..105d276 100644 --- a/src/blogs/capability_develop.md +++ b/src/content/blog/develop.md @@ -2,8 +2,8 @@ title: "Develop" description: "Build and deploy applications faster with local AI and secure storage" icon: "Users" -image: "/src/assets/develop.jpg" -cat: "capability" +image: "develop.jpg" + order: 4 slug: "develop" --- diff --git a/src/blogs/capability_discover.md b/src/content/blog/discover.md similarity index 95% rename from src/blogs/capability_discover.md rename to src/content/blog/discover.md index a338e4f..3505bde 100644 --- a/src/blogs/capability_discover.md +++ b/src/content/blog/discover.md @@ -2,8 +2,8 @@ title: "Discover" description: "Browse and search using authentic sources and AI assistance while maintaining privacy" icon: "Shield" -image: "/src/assets/discover.jpg" -cat: "capability" +image: "discover.jpg" + order: 3 slug: "discover" --- diff --git a/src/blogs/from-centralized-to-sovereign-the-evolution-of-digital-identity.md b/src/content/blog/from-centralized-to-sovereign-the-evolution-of-digital-identity.md similarity index 85% rename from src/blogs/from-centralized-to-sovereign-the-evolution-of-digital-identity.md rename to src/content/blog/from-centralized-to-sovereign-the-evolution-of-digital-identity.md index 8cdf263..dd35ca5 100644 --- a/src/blogs/from-centralized-to-sovereign-the-evolution-of-digital-identity.md +++ b/src/content/blog/from-centralized-to-sovereign-the-evolution-of-digital-identity.md @@ -4,11 +4,11 @@ author: "Alex Rodriguez" date: "December 10, 2024" readTime: "5 min read" tags: ["Identity", "Blockchain", "Sovereignty"] -image: "/src/assets/white_keyb.jpg" +image: "white_keyb.jpg" description: "Tracing the journey from corporate-controlled identities to blockchain-verified, user-owned digital personas. The future is sovereign." featured: false draft: false -cat: "blog" + slug: "from-centralized-to-sovereign-the-evolution-of-digital-identity" --- diff --git a/src/blogs/peer-to-peer-communication-cutting-out-the-middleman.md b/src/content/blog/peer-to-peer-communication-cutting-out-the-middleman.md similarity index 81% rename from src/blogs/peer-to-peer-communication-cutting-out-the-middleman.md rename to src/content/blog/peer-to-peer-communication-cutting-out-the-middleman.md index 23e1081..f7c2170 100644 --- a/src/blogs/peer-to-peer-communication-cutting-out-the-middleman.md +++ b/src/content/blog/peer-to-peer-communication-cutting-out-the-middleman.md @@ -4,10 +4,10 @@ author: "HERO Team" date: "December 1, 2024" readTime: "6 min read" tags: ["Communication", "P2P", "Privacy"] -image: "/src/assets/heart.jpg" +image: "heart.jpg" featured: false draft: false -cat: "blog" + slug: "peer-to-peer-communication-cutting-out-the-middleman" --- diff --git a/src/blogs/quantum-safe-storage-protecting-your-digital-legacy.md b/src/content/blog/quantum-safe-storage-protecting-your-digital-legacy.md similarity index 82% rename from src/blogs/quantum-safe-storage-protecting-your-digital-legacy.md rename to src/content/blog/quantum-safe-storage-protecting-your-digital-legacy.md index 8c39f8d..525b82c 100644 --- a/src/blogs/quantum-safe-storage-protecting-your-digital-legacy.md +++ b/src/content/blog/quantum-safe-storage-protecting-your-digital-legacy.md @@ -4,10 +4,10 @@ author: "Dr. Michael Park" date: "December 5, 2024" readTime: "9 min read" tags: ["Quantum Computing", "Storage", "Security"] -image: "/src/assets/balls.jpg" +image: "balls.jpg" featured: false draft: false -cat: "blog" + slug: "quantum-safe-storage-protecting-your-digital-legacy" --- diff --git a/src/blogs/capability_share.md b/src/content/blog/share.md similarity index 94% rename from src/blogs/capability_share.md rename to src/content/blog/share.md index 55f5c61..8e4b6a8 100644 --- a/src/blogs/capability_share.md +++ b/src/content/blog/share.md @@ -2,8 +2,8 @@ title: "Share" description: "Distribute content without central platforms — sovereignly and securely" icon: "Lock" -image: "/src/assets/share.jpg" -cat: "capability" +image: "share.jpg" + order: 5 slug: "share" --- diff --git a/src/blogs/the-economics-of-digital-sovereignty.md b/src/content/blog/the-economics-of-digital-sovereignty.md similarity index 84% rename from src/blogs/the-economics-of-digital-sovereignty.md rename to src/content/blog/the-economics-of-digital-sovereignty.md index 52895c3..53fb377 100644 --- a/src/blogs/the-economics-of-digital-sovereignty.md +++ b/src/content/blog/the-economics-of-digital-sovereignty.md @@ -4,11 +4,11 @@ author: "Emma Thompson" date: "December 3, 2024" readTime: "4 min read" tags: ["Economics", "Privacy", "Value"] -image: "/src/assets/white_keyb.jpg" +image: "white_keyb.jpg" description: "Why paying $20/month for digital freedom is the best investment you'll ever make. Breaking down the true cost of corporate data harvesting." featured: false draft: false -cat: "blog" + slug: "the-economics-of-digital-sovereignty" --- diff --git a/src/blogs/the-future-of-digital-sovereignty-why-personal-agents-matter.md b/src/content/blog/the-future-of-digital-sovereignty-why-personal-agents-matter.md similarity index 88% rename from src/blogs/the-future-of-digital-sovereignty-why-personal-agents-matter.md rename to src/content/blog/the-future-of-digital-sovereignty-why-personal-agents-matter.md index 727ffe5..e5c68a4 100644 --- a/src/blogs/the-future-of-digital-sovereignty-why-personal-agents-matter.md +++ b/src/content/blog/the-future-of-digital-sovereignty-why-personal-agents-matter.md @@ -4,11 +4,11 @@ author: "HERO Team" date: "December 15, 2024" readTime: "8 min read" tags: ["Digital Sovereignty", "Privacy", "AI"] -image: "/src/assets/heart.jpg" +image: "heart.jpg" description: "In an era where tech giants control our digital lives, Personal Agents represent a fundamental shift toward individual sovereignty and privacy. Discover how HERO is leading this revolution." featured: true draft: false -cat: "blog" + slug: "the-future-of-digital-sovereignty-why-personal-agents-matter" --- diff --git a/src/blogs/capability_transact.md b/src/content/blog/transact.md similarity index 96% rename from src/blogs/capability_transact.md rename to src/content/blog/transact.md index e148694..4050540 100644 --- a/src/blogs/capability_transact.md +++ b/src/content/blog/transact.md @@ -2,8 +2,8 @@ title: "Transact" description: "Send and receive digital value safely and without intermediaries" icon: "Heart" -image: "/src/assets/transact.jpg" -cat: "capability" +image: "transact.jpg" + order: 6 slug: "transact" --- diff --git a/src/blogs/component_ai-agents-on-your-terms.md b/src/content/component/ai-agents-on-your-terms.md similarity index 96% rename from src/blogs/component_ai-agents-on-your-terms.md rename to src/content/component/ai-agents-on-your-terms.md index f902f82..b0605c4 100644 --- a/src/blogs/component_ai-agents-on-your-terms.md +++ b/src/content/component/ai-agents-on-your-terms.md @@ -3,10 +3,10 @@ title: "AI Agents on Your Terms" author: "HERO Team" date: "2023-10-26" readTime: "7 min read" -image: "/src/assets/itworks.jpg" +image: "itworks.jpg" +iconname: "Brain" description: "HERO connects with a wide range of AI agents for research, content creation, and task automation. All computation is done locally or via trusted partners." tags: ["components", "ai-agents", "how-it-works"] -cat: component slug: ai-agents-on-your-terms --- diff --git a/src/blogs/component_personal-agent.md b/src/content/component/personal-agent.md similarity index 95% rename from src/blogs/component_personal-agent.md rename to src/content/component/personal-agent.md index 61e9966..5b8d574 100644 --- a/src/blogs/component_personal-agent.md +++ b/src/content/component/personal-agent.md @@ -3,10 +3,11 @@ title: "Your Personal Agent" author: "HERO Team" date: "2023-10-26" readTime: "5 min read" -image: "/src/assets/balls.jpg" +image: "balls.jpg" description: "Your HERO acts as your digital assistant, managing messaging, meetings, calendar, documents, tasks, AI interactions, personal identity, credentials, and financial transactions." tags: ["components", "personal-agent", "how-it-works"] -cat: component +iconname: "User" +order: 1 slug: personal-agent --- diff --git a/src/blogs/component_private-ledger.md b/src/content/component/private-ledger.md similarity index 96% rename from src/blogs/component_private-ledger.md rename to src/content/component/private-ledger.md index ddf6d94..b8b3e6a 100644 --- a/src/blogs/component_private-ledger.md +++ b/src/content/component/private-ledger.md @@ -3,10 +3,11 @@ title: "A Private Ledger Just for You" author: "HERO Team" date: "2023-10-26" readTime: "8 min read" -image: "/src/assets/tech.jpg" +image: "tech.jpg" description: "Every HERO maintains a private blockchain ledger that verifies identity, manages access control, tracks interactions, and can communicate securely with other ledgers." tags: ["components", "ledger", "how-it-works"] -cat: component +iconname: "Key" +order: 4 slug: private-ledger --- diff --git a/src/blogs/component_secure-unbreakable-memory.md b/src/content/component/secure-unbreakable-memory.md similarity index 96% rename from src/blogs/component_secure-unbreakable-memory.md rename to src/content/component/secure-unbreakable-memory.md index 5fdb604..8f53382 100644 --- a/src/blogs/component_secure-unbreakable-memory.md +++ b/src/content/component/secure-unbreakable-memory.md @@ -3,10 +3,11 @@ title: "Secure, Unbreakable Memory" author: "HERO Team" date: "2023-10-26" readTime: "6 min read" -image: "/src/assets/white_keyb.jpg" +image: "white_keyb.jpg" description: "Uses a zero-knowledge, quantum-safe dispersal algorithm. Memory is stored across multiple nodes with no single point of failure. You control the geographic placement of your data." tags: ["components", "memory", "how-it-works"] -cat: component +iconname: "Database" +order: 2 slug: secure-unbreakable-memory --- diff --git a/src/blogs/freezone_dispute-resolution.md b/src/content/freezone/dispute-resolution.md similarity index 96% rename from src/blogs/freezone_dispute-resolution.md rename to src/content/freezone/dispute-resolution.md index d6dfb76..4056a51 100644 --- a/src/blogs/freezone_dispute-resolution.md +++ b/src/content/freezone/dispute-resolution.md @@ -2,7 +2,7 @@ title: Dispute Resolution (AI & People) slug: dispute-resolution-ai-and-people description: Explore the innovative dispute resolution mechanisms available within a digital freezone, combining AI efficiency with human oversight. -image: /src/assets/disputeresolution.jpg +image: disputeresolution.jpg --- Disputes are an inevitable part of any business or personal interaction. A digital freezone introduces a novel approach to dispute resolution, integrating the efficiency of artificial intelligence with the nuanced judgment of human experts, ensuring fair and swift outcomes. diff --git a/src/blogs/freezone_keep-your-assets-safe.md b/src/content/freezone/keep-your-assets-safe.md similarity index 97% rename from src/blogs/freezone_keep-your-assets-safe.md rename to src/content/freezone/keep-your-assets-safe.md index 18509f1..9be53b0 100644 --- a/src/blogs/freezone_keep-your-assets-safe.md +++ b/src/content/freezone/keep-your-assets-safe.md @@ -2,7 +2,7 @@ title: Keep Your Assets Safe Now and in Future slug: keep-your-assets-safe-now-and-in-future description: Discover how a digital freezone provides robust protection for your assets against current and future threats. -image: /src/assets/world.jpg +image: world.jpg --- In an era of increasing digital threats and economic uncertainties, securing your assets is more critical than ever. A digital freezone offers a fortified environment designed to protect your digital wealth, ensuring its safety both today and in the years to come. diff --git a/src/blogs/freezone_legal-and-financial-sovereignty.md b/src/content/freezone/legal-and-financial-sovereignty.md similarity index 97% rename from src/blogs/freezone_legal-and-financial-sovereignty.md rename to src/content/freezone/legal-and-financial-sovereignty.md index c36ae09..7715a7e 100644 --- a/src/blogs/freezone_legal-and-financial-sovereignty.md +++ b/src/content/freezone/legal-and-financial-sovereignty.md @@ -2,7 +2,7 @@ title: Legal and Financial Sovereignty slug: legal-and-financial-sovereignty description: Understand how a digital freezone provides unparalleled legal and financial sovereignty for your operations. -image: /src/assets/freezone.jpg +image: freezone.jpg --- In an increasingly interconnected world, maintaining legal and financial sovereignty is paramount for individuals and businesses alike. Digital freezones offer a revolutionary approach to achieving this, providing a secure and independent environment for your digital assets and operations. diff --git a/src/blogs/freezone_ultimate-convenience-and-features.md b/src/content/freezone/ultimate-convenience-and-features.md similarity index 94% rename from src/blogs/freezone_ultimate-convenience-and-features.md rename to src/content/freezone/ultimate-convenience-and-features.md index 8de0650..59c67d1 100644 --- a/src/blogs/freezone_ultimate-convenience-and-features.md +++ b/src/content/freezone/ultimate-convenience-and-features.md @@ -2,7 +2,7 @@ title: Ultimate in Convenience and Features slug: ultimate-in-convenience-and-features description: Experience unparalleled convenience and a rich suite of features designed to make your business life fun again within a digital freezone. -image: /src/assets/stresssfree.jpg +image: stresssfree.jpg --- Imagine a business environment where every tool you need is at your fingertips, processes are streamlined, and innovation thrives. A digital freezone delivers this reality, offering an ultimate blend of convenience and advanced features that transform the way you work. diff --git a/src/blogs/tech_blockchain-identity.md b/src/content/tech/blockchain-identity.md similarity index 92% rename from src/blogs/tech_blockchain-identity.md rename to src/content/tech/blockchain-identity.md index c2e7bd1..7b78ed8 100644 --- a/src/blogs/tech_blockchain-identity.md +++ b/src/content/tech/blockchain-identity.md @@ -3,10 +3,10 @@ title: "Blockchain Identity" author: "HERO Team" date: "2023-10-26" readTime: "7 min read" -image: "/src/assets/heartblue.jpg" +image: "heartblue.jpg" description: "Cryptographically verified identity system built on blockchain technology. You control your reputation and trust relationships." tags: ["technology", "blockchain", "identity", "security"] -cat: tech + slug: blockchain-identity --- diff --git a/src/blogs/tech_peer-to-peer-network.md b/src/content/tech/peer-to-peer-network.md similarity index 93% rename from src/blogs/tech_peer-to-peer-network.md rename to src/content/tech/peer-to-peer-network.md index ae1824d..f6e3a36 100644 --- a/src/blogs/tech_peer-to-peer-network.md +++ b/src/content/tech/peer-to-peer-network.md @@ -3,10 +3,10 @@ title: "Peer-to-Peer Network" author: "HERO Team" date: "2023-10-26" readTime: "6 min read" -image: "/src/assets/sphere.jpg" +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"] -cat: tech + slug: peer-to-peer-network --- diff --git a/src/blogs/tech_quantum-safe-storage.md b/src/content/tech/quantum-safe-storage.md similarity index 93% rename from src/blogs/tech_quantum-safe-storage.md rename to src/content/tech/quantum-safe-storage.md index f4afb64..d879c76 100644 --- a/src/blogs/tech_quantum-safe-storage.md +++ b/src/content/tech/quantum-safe-storage.md @@ -3,10 +3,10 @@ title: "Quantum-Safe Storage" author: "HERO Team" date: "2023-10-26" readTime: "8 min read" -image: "/src/assets/swarm.jpg" +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"] -cat: tech + slug: quantum-safe-storage --- diff --git a/src/blogs/tech_zero-knowledge-architecture.md b/src/content/tech/zero-knowledge-architecture.md similarity index 93% rename from src/blogs/tech_zero-knowledge-architecture.md rename to src/content/tech/zero-knowledge-architecture.md index be7f267..8b926a6 100644 --- a/src/blogs/tech_zero-knowledge-architecture.md +++ b/src/content/tech/zero-knowledge-architecture.md @@ -3,10 +3,10 @@ title: "Zero-Knowledge Architecture" author: "HERO Team" date: "2023-10-26" readTime: "7 min read" -image: "/src/assets/person.jpg" +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"] -cat: tech + slug: zero-knowledge-architecture --- diff --git a/src/pages/Blog.jsx b/src/pages/Blog.jsx index afc1c8f..47797a6 100644 --- a/src/pages/Blog.jsx +++ b/src/pages/Blog.jsx @@ -13,7 +13,7 @@ import blogBackground from '../assets/myhero.jpg'; import defaultPostImage from '../assets/myhero.jpg'; // Using an existing image as a fallback // Use Vite's import.meta.glob to import all markdown files -const modules = import.meta.glob('../blogs/*.md', { query: '?raw', import: 'default', eager: true }); +const modules = import.meta.glob('../content/blog/*.md', { query: '?raw', import: 'default', eager: true }); const Blog = () => { const [posts, setPosts] = useState([]); @@ -31,12 +31,10 @@ const Blog = () => { // Extract slug from filename const slug = path.split('/').pop().replace('.md', ''); - // Only include posts that are not drafts and have cat="blog" - if (frontmatter.draft !== true && frontmatter.cat === 'blog') { + if (frontmatter.draft !== true) { loadedPosts.push({ ...frontmatter, slug, - // Ensure image path is correct for Vite, use defaultPostImage as fallback image: frontmatter.image ? new URL(frontmatter.image, import.meta.url).href : defaultPostImage }); } @@ -155,7 +153,7 @@ const Blog = () => { - + {
{blogPosts.map((post) => ( - + {
- {post.tags.slice(0, 2).map((tag) => ( + {post.tags?.slice(0, 2).map((tag) => ( { - const { slug } = useParams(); + const { category, slug } = useParams(); // category will be undefined for /component/:slug + const location = useLocation(); const [post, setPost] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); @@ -16,27 +19,54 @@ const BlogPost = () => { useEffect(() => { const loadPost = async () => { try { - const allModules = import.meta.glob('../blogs/*.md', { query: '?raw', import: 'default', eager: true }); - let foundPost = null; + let contentModule; + let basePath; + let currentSlug = slug; // Use slug from useParams - for (const path in allModules) { - const content = allModules[path]; - const { data: frontmatter, content: markdownContent } = matter(content); - - // Generate slug from filename if not present in frontmatter - const postSlug = frontmatter.slug || path.split('/').pop().replace('.md', ''); + // Determine content type based on pathname + const pathSegments = location.pathname.split('/').filter(Boolean); + let contentType = ''; - // Check if the generated slug matches the URL slug - if (postSlug === slug) { - foundPost = { frontmatter, content: markdownContent }; - break; - } - } - - if (foundPost) { - setPost(foundPost); + if (pathSegments[0] === 'blog' && pathSegments.length >= 3) { + contentType = 'blog'; + // For blog posts, category is the second segment, slug is the third + currentSlug = pathSegments[2]; + basePath = `../content/blog/${pathSegments[1]}/`; // blog/:category/:slug + } else if (pathSegments[0] === 'component' && pathSegments.length >= 2) { + contentType = 'component'; + currentSlug = pathSegments[1]; // component/:slug + basePath = '../content/component/'; + } else if (pathSegments[0] === 'technology' && pathSegments.length >= 2) { + contentType = 'tech'; + currentSlug = pathSegments[1]; + basePath = '../content/tech/'; + } else if (pathSegments[0] === 'freezone' && pathSegments.length >= 2) { + contentType = 'freezone'; + currentSlug = pathSegments[1]; + basePath = '../content/freezone/'; } else { - setError('Post not found'); + setError('Invalid URL path for content.'); + setLoading(false); + return; + } + + try { + const modules = import.meta.glob('../content/**/*.md', { as: 'raw', eager: true }); + const fullPath = `${basePath}${currentSlug}.md`; + contentModule = modules[fullPath]; + + if (!contentModule) { + throw new Error(`Markdown file not found at ${fullPath}`); + } + + const { data: frontmatter, content: markdownContent } = matter(contentModule); + + // Resolve image path + const resolvedImage = frontmatter.image ? imageModules[`../assets/${frontmatter.image}`] : null; + + setPost({ frontmatter: { ...frontmatter, image: resolvedImage }, content: markdownContent, contentType }); // Store contentType and resolved image with post + } catch (err) { + setError(`Failed to load content: ${err.message}. Please ensure the file exists and is correctly formatted.`); } } catch (err) { setError(err.message); @@ -46,7 +76,7 @@ const BlogPost = () => { }; loadPost(); - }, [slug]); + }, [location.pathname, slug]); // Depend on pathname and slug if (loading) { return ( @@ -64,14 +94,33 @@ const BlogPost = () => { ); } + const getBackLink = () => { + // Use post.contentType to determine the back link + if (!post || !post.contentType) { + return '/'; // Default to home if content type is unknown + } + switch (post.contentType) { + case 'component': + return '/how'; + case 'blog': + return '/blog'; + case 'tech': + return '/technology'; + case 'freezone': + return '/freezone'; + default: + return '/'; + } + }; + return (
- +
@@ -161,4 +210,4 @@ const BlogPost = () => { ); }; -export default BlogPost; \ No newline at end of file +export default BlogPost; diff --git a/src/pages/Freezone.jsx b/src/pages/Freezone.jsx index 2caa89f..4adcec6 100644 --- a/src/pages/Freezone.jsx +++ b/src/pages/Freezone.jsx @@ -15,7 +15,7 @@ const disputeresolutionImage = new URL('../assets/disputeresolution.jpg', import const stresssfreeImage = new URL('../assets/stresssfree.jpg', import.meta.url).href; // Use Vite's import.meta.glob to import all freezone markdown files -const freezoneModules = import.meta.glob('../blogs/freezone_*.md', { query: '?raw', import: 'default', eager: true }); +const freezoneModules = import.meta.glob('../content/freezone/*.md', { query: '?raw', import: 'default', eager: true }); const Freezone = () => { const [articles, setArticles] = useState([]); @@ -155,7 +155,7 @@ const Freezone = () => { )) ) : ( articles.map((article, index) => ( - + { const [components, setComponents] = useState([]); @@ -30,27 +29,15 @@ const How = () => { const content = componentModules[path]; const { data: frontmatter } = matter(content); - // Map icon strings to actual components - const iconMap = { - 'User': , - 'Database': , - 'Brain': , - 'Key': - }; - - // Map image paths to actual imports - const imageMap = { - '/src/assets/balls.jpg': agentImage, - '/src/assets/white_keyb.jpg': memoryImage, - '/src/assets/itworks.jpg': networkImage, - '/src/assets/tech.jpg': ledgerImage - }; + const IconComponent = iconComponents[frontmatter.iconname]; + const imagePath = `../assets/${frontmatter.image}`; // Construct full path + const importedImage = imageModules[imagePath]; loadedComponents.push({ - icon: iconMap[frontmatter.icon] || , + icon: IconComponent ? : , title: frontmatter.title, description: frontmatter.description, - image: imageMap[frontmatter.image] || agentImage, + image: importedImage, order: frontmatter.order || 999, slug: frontmatter.slug || frontmatter.title.toLowerCase().replace(/\s+/g, '-') }); @@ -61,37 +48,6 @@ const How = () => { setComponents(loadedComponents); } catch (error) { console.error('Error loading components:', error); - // Fallback to static data if loading fails (optional, but good for robustness) - setComponents([ - { - icon: , - title: "Your Personal Agent", - description: "Your HERO acts as your digital assistant, managing messaging, meetings, calendar, documents, tasks, AI interactions, personal identity, credentials, and financial transactions.", - image: agentImage, - slug: "personal-agent" - }, - { - icon: , - title: "Secure, Unbreakable Memory", - description: "Uses a zero-knowledge, quantum-safe dispersal algorithm. Memory is stored across multiple nodes with no single point of failure. You control the geographic placement of your data.", - image: memoryImage, - slug: "secure-unbreakable-memory" - }, - { - icon: , - title: "AI Agents on Your Terms", - description: "HERO connects with a wide range of AI agents for research, content creation, and task automation. All computation is done locally or via trusted partners.", - image: networkImage, - slug: "ai-agents-on-your-terms" - }, - { - icon: , - title: "A Private Ledger Just for You", - description: "Every HERO maintains a private blockchain ledger that verifies identity, manages access control, tracks interactions, and can communicate securely with other ledgers.", - image: ledgerImage, - slug: "private-ledger" - } - ]); } finally { setLoading(false); } diff --git a/src/pages/Technology.jsx b/src/pages/Technology.jsx index fdacbe5..de02c88 100644 --- a/src/pages/Technology.jsx +++ b/src/pages/Technology.jsx @@ -15,7 +15,7 @@ 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('../blogs/tech_*.md', { query: '?raw', import: 'default', eager: true }); +const techModules = import.meta.glob('../content/tech/*.md', { query: '?raw', import: 'default', eager: true }); const Technology = () => { const [technologies, setTechnologies] = useState([]); @@ -225,7 +225,7 @@ const Technology = () => { )) ) : ( technologies.map((spec, index) => ( - +