Adjustments to slug processing

This commit is contained in:
Cássio Zen
2016-12-15 16:20:54 -02:00
parent 9d02b54ce7
commit 5cc17c05e5

View File

@ -36,7 +36,7 @@ const slugFormatter = (template = '{{slug}}', entryData) => {
case 'slug': case 'slug':
return identifier.trim().toLowerCase().replace(/[^a-z0-9\.\-_]+/gi, '-'); return identifier.trim().toLowerCase().replace(/[^a-z0-9\.\-_]+/gi, '-');
default: default:
return entryData.get(field); return entryData.get(field, '').trim().toLowerCase().replace(/[^a-z0-9\.\-_]+/gi, '-');
} }
}); });
}; };
@ -175,8 +175,7 @@ class Backend {
} }
const commitMessage = `${ (newEntry ? 'Created ' : 'Updated ') + const commitMessage = `${ (newEntry ? 'Created ' : 'Updated ') +
collection.get('label') }${ collection.get('label') }${ entryObj.slug }`;
entryDraft.getIn(['entry', 'data', 'title']) }`;
const mode = config.get('publish_mode'); const mode = config.get('publish_mode');