Skip to content

Commit dca1b81

Browse files
Add post excerpt to WordPress.com importer
Prior to this PR, the XML importer for WordPress would ignore the `post_excerpt` field. This is useful for SEO purposes (for the meta description in templates) as well as for other potential uses when display the content in a list view.
1 parent c8235d2 commit dca1b81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/jekyll-import/importers/wordpressdotcom.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ def self.process(options)
117117

118118
begin
119119
content = Hpricot(item.at('content:encoded').inner_text)
120+
excerpt = Hpricot(item.at('excerpt:encoded').inner_text)
121+
122+
if excerpt
123+
header['excerpt'] = excerpt
124+
end
120125

121126
if fetch
122127
download_images(title, content, assets_folder)

0 commit comments

Comments
 (0)