Documentation and output for custom post types

This commit is contained in:
Will Boyd
2020-12-27 14:05:48 -05:00
parent d6ef25b764
commit 828230dedd
4 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -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 &lt;img&gt; tags in post body content. Images are saved into `/images`. The &lt;img&gt; 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
View File
@@ -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
View File
@@ -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
})); }));