mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-17 21:53:49 +09:00
Frontmatter getters comments
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const settings = require('../settings');
|
||||
|
||||
// get array of categories for post, filtered as specified in settings
|
||||
module.exports = (post) => {
|
||||
if (!post.data.category) {
|
||||
return [];
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// get cover image filename, previously set on post.meta
|
||||
// this one is unique as it relies on logic executed by the parser
|
||||
module.exports = (post) => {
|
||||
return post.meta.coverImage;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ const luxon = require('luxon');
|
||||
|
||||
const settings = require('../settings');
|
||||
|
||||
// get post date, optionally formatted as specified in settings
|
||||
module.exports = (post) => {
|
||||
const dateTime = luxon.DateTime.fromRFC2822(post.data.pubDate[0], { zone: 'utc' });
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// get array of tags for post
|
||||
module.exports = (post) => {
|
||||
if (!post.data.category) {
|
||||
return [];
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// get simple post title
|
||||
module.exports = (post) => {
|
||||
return post.data.title[0];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user