Fix: Blog URLs and remove duplicate AI Automation links
Fixes:
1. Blog URLs now correct (without .md extension)
- Changed from: /blog/core-web-vitals.md/
- Changed to: /blog/core-web-vitals/
2. Fixed duplicate AI Automation in navigation
- Removed duplicate from header submenu
- Removed duplicate from mobile menu
- Removed duplicate from footer
- Now 4 unique services in all menus
Blog:
- getStaticPaths: slug.replace('.md', '')
- blog/index.astro: links use slug.replace('.md', '')
- Blog builds to correct URLs without .md
Navigation:
- Header submenu: 4 services (not 5)
- Mobile menu: 4 services (not 5)
- Footer: 4 services (was 5 with duplicate)
Services (4 unique):
1. พัฒนาเว็บไซต์
2. AI Automation
3. พัฒนาแอปพลิเคชัน
4. ที่ปรึกษาการตลาดออนไลน์
This commit is contained in:
@@ -5,7 +5,7 @@ import { getCollection } from 'astro:content';
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.id },
|
||||
params: { slug: post.id.replace('.md', '') },
|
||||
props: { post },
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user