mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-11 18:56:14 +09:00
Example/debug frontmatter getter
This commit is contained in:
+3
-2
@@ -171,7 +171,7 @@ function mergeImagesIntoPosts(images, posts) {
|
||||
|
||||
function populateFrontmatter(posts) {
|
||||
posts.forEach(post => {
|
||||
post.frontmatter = {};
|
||||
const frontmatter = {};
|
||||
settings.frontmatter_fields.forEach(field => {
|
||||
[key, alias] = field.split(':');
|
||||
|
||||
@@ -180,8 +180,9 @@ function populateFrontmatter(posts) {
|
||||
throw `Could not find a frontmatter getter named "${key}".`;
|
||||
}
|
||||
|
||||
post.frontmatter[alias || key] = frontmatterGetter(post);
|
||||
frontmatter[alias || key] = frontmatterGetter(post);
|
||||
});
|
||||
post.frontmatter = frontmatter;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user