Take permalink name directly from worpress export file.

This commit is contained in:
Elia Schito 2011-01-27 13:12:08 +01:00
parent ca48ea91e6
commit c70dac3cee
1 changed files with 2 additions and 1 deletions

View File

@ -19,9 +19,10 @@ module Jekyll
(doc/:channel/:item).each do |item| (doc/:channel/:item).each do |item|
title = item.at(:title).inner_text.strip title = item.at(:title).inner_text.strip
permalink_title = item.at('wp:post_name').inner_text
date = Time.parse(item.at(:pubDate).inner_text) date = Time.parse(item.at(:pubDate).inner_text)
tags = (item/:category).map{|c| c.inner_text}.reject{|c| c == 'Uncategorized'}.uniq tags = (item/:category).map{|c| c.inner_text}.reject{|c| c == 'Uncategorized'}.uniq
name = "#{date.strftime("%Y-%m-%d")}-#{title.downcase.tr('áéíóúàèìòùâêîôûãẽĩõũñäëïöüç','aeiouaeiouaeiouaeiounaeiouc').gsub(/\W+/, '-')}.html" name = "#{date.strftime('%Y-%m-%d')}-#{permalink_title}.html"
header = { header = {
'layout' => 'post', 'layout' => 'post',
'title' => title, 'title' => title,