mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-11 18:56:14 +09:00
Documentation and output for custom post types
This commit is contained in:
@@ -153,7 +153,15 @@ Whether or not to download and save images attached to posts. Generally speaking
|
|||||||
- Type: `boolean`
|
- Type: `boolean`
|
||||||
- Default: `true`
|
- Default: `true`
|
||||||
|
|
||||||
Whether or not to download and save images scraped from <img> tags in post body content. Images are saved into `/images`. The <img> tags are updated to point to where the images are saved.
|
Whether or not to download and save images scraped from `<img>` tags in post body content. Images are saved into `/images`. The `<img>` tags are updated to point to where the images are saved.
|
||||||
|
|
||||||
|
### Include custom post types and pages?
|
||||||
|
|
||||||
|
- Argument: `--include-other-types`
|
||||||
|
- Type: `boolean`
|
||||||
|
- Default: `false`
|
||||||
|
|
||||||
|
Some WordPress sites make use of a `"page"` post type and/or custom post types. Set this to `true` to include these post types in the results. Posts will be organized into post type folders.
|
||||||
|
|
||||||
## Advanced Settings
|
## Advanced Settings
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ function getItemTypes(data, config) {
|
|||||||
// effectively this will be 'post', 'page', and custom post types
|
// effectively this will be 'post', 'page', and custom post types
|
||||||
const types = data.rss.channel[0].item
|
const types = data.rss.channel[0].item
|
||||||
.map(item => item.post_type[0])
|
.map(item => item.post_type[0])
|
||||||
.filter(type => !['attachment', 'revision', 'nav_menu_item'].includes(type));
|
.filter(type => !['attachment', 'revision', 'nav_menu_item', 'custom_css', 'customize_changeset'].includes(type));
|
||||||
return [...new Set(types)]; // remove duplicates
|
return [...new Set(types)]; // remove duplicates
|
||||||
} else {
|
} else {
|
||||||
// just plain old vanilla "post" posts
|
// just plain old vanilla "post" posts
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ async function writeMarkdownFilesPromise(posts, config ) {
|
|||||||
// package up posts into payloads
|
// package up posts into payloads
|
||||||
const payloads = posts.map((post, index) => ({
|
const payloads = posts.map((post, index) => ({
|
||||||
item: post,
|
item: post,
|
||||||
name: post.meta.slug,
|
name: (config.includeOtherTypes ? post.meta.type + ' - ' : '') + post.meta.slug,
|
||||||
destinationPath: getPostPath(post, config),
|
destinationPath: getPostPath(post, config),
|
||||||
delay: index * settings.markdown_file_write_delay
|
delay: index * settings.markdown_file_write_delay
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user