refactor: update content structure and layout templates
- Updated author format in content files - Added section field to content files - Simplified categories format - Removed no-category.html layout - Updated list.html and single.html layouts - Updated index.html layout - Updated generate-content.js script - Do not index content with git
This commit is contained in:
@@ -37,21 +37,10 @@ function generateContent() {
|
||||
wordpress_id: post.id,
|
||||
excerpt: post.excerpt.rendered.replace(/<[^>]*>/g, ''),
|
||||
featured_image: post._embedded?.['wp:featuredmedia']?.[0]?.source_url || '',
|
||||
author: {
|
||||
id: post.author,
|
||||
name: post._embedded?.author?.[0]?.name || 'Unknown'
|
||||
},
|
||||
categories: post._embedded?.['wp:term']?.[0]?.map(cat => ({
|
||||
id: cat.id,
|
||||
name: cat.name,
|
||||
slug: cat.slug
|
||||
})) || [],
|
||||
tags: post._embedded?.['wp:term']?.[1]?.map(tag => ({
|
||||
id: tag.id,
|
||||
name: tag.name,
|
||||
slug: tag.slug
|
||||
})) || [],
|
||||
// section: categorySlug
|
||||
author: post._embedded?.author?.[0]?.name || 'Unknown',
|
||||
categories: (post._embedded?.['wp:term']?.[0] || []).map(cat => cat.name || 'Non classé'),
|
||||
tags: (post._embedded?.['wp:term']?.[1] || []).map(cat => cat.name || 'Non classé'),
|
||||
section: categorySlug
|
||||
};
|
||||
|
||||
const content = `---
|
||||
|
||||
Reference in New Issue
Block a user