Only set 'url' if permalink in metadata and remove duplicate confirm msg
authorColin Seymour <lildood@gmail.com>
Thu, 11 Jan 2018 16:42:49 +0000 (16:42 +0000)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 28 Jan 2018 10:24:31 +0000 (11:24 +0100)
commit3752348ef13ced8f6f528b42ee7d76a12a97ae5c
treea7227c1a3af89f2516095ea96c35f86c3acc7504
parent4eb2fec67c3a72a3ac98aa834dc56fd4504626d8
Only set 'url' if permalink in metadata and remove duplicate confirm msg

The current behaviour addes a `url` attribute to the frontmatter of all posts imported from Jeklly and assumes the desired permalink structure is /:year/:month/:day/:title/. This may be the case for most peeps, but poses a problem for those that don't use this permalink structure as the `url` attribute takes precedence over the `permalink` attribute in the site-wide configuration meaning it can't be overruled.

This changes the behaviour to only set the `url` attribute if the `permalink` attribute is set in the Jekyll frontmatter.

The duplication of the confirmation message is also removed.

Tests have been updated to reflect this change in behaviour.

Fixes #1887
commands/import_jekyll.go
commands/import_jekyll_test.go