This commit is contained in:
despiegk 2025-08-03 10:01:35 +02:00
parent bcffa1147f
commit dc83f8dbad
5 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@ author: "HERO Team"
date: "December 1, 2024"
readTime: "6 min read"
tags: ["Communication", "P2P", "Privacy"]
image: "heart.jpg"
image: "city_digital.jpg"
featured: false
draft: false

View File

@ -4,7 +4,7 @@ author: "Dr. Michael Park"
date: "December 5, 2024"
readTime: "9 min read"
tags: ["Quantum Computing", "Storage", "Security"]
image: "balls.jpg"
image: "swarm.jpg"
featured: false
draft: false

View File

@ -4,7 +4,7 @@ author: "Emma Thompson"
date: "December 3, 2024"
readTime: "4 min read"
tags: ["Economics", "Privacy", "Value"]
image: "white_keyb.jpg"
image: "pathforward.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

View File

@ -13,7 +13,8 @@ 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('../content/blog/*.md', { query: '?raw', import: 'default', eager: true });
const modules = import.meta.glob('../content/blog/*.md', { as: 'raw', eager: true });
const imageModules = import.meta.glob('../assets/*.jpg', { eager: true, import: 'default' });
const Blog = () => {
const [posts, setPosts] = useState([]);
@ -35,7 +36,7 @@ const Blog = () => {
loadedPosts.push({
...frontmatter,
slug,
image: frontmatter.image ? new URL(frontmatter.image, import.meta.url).href : defaultPostImage
image: frontmatter.image ? imageModules[`../assets/${frontmatter.image}`] : defaultPostImage
});
}
}

View File

@ -31,7 +31,7 @@ const BlogPost = () => {
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
basePath = `../content/blog/`; // blog/:category/:slug
} else if (pathSegments[0] === 'component' && pathSegments.length >= 2) {
contentType = 'component';
currentSlug = pathSegments[1]; // component/:slug