Skip to content

Commit

Permalink
Aliases now respect the 'source' config
Browse files Browse the repository at this point in the history
Alias markdown files were being generated in the current directory
instead of the directory defined by the "source" configuration option.
  • Loading branch information
hugopeixoto committed Sep 17, 2021
1 parent 45a3abf commit 66a3434
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/jekyll-import/importers/drupal_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def process(options)
src_dir = conf["source"]

dirs = {
:_aliases => src_dir,
:_posts => File.join(src_dir, "_posts").to_s,
:_drafts => File.join(src_dir, "_drafts").to_s,
:_layouts => Jekyll.sanitized_path(src_dir, conf["layouts_dir"].to_s),
Expand Down Expand Up @@ -141,12 +142,12 @@ def process(options)
end

partition = url_alias[:alias].rpartition("/")
dir = ""
dir = "#{dirs[:_aliases]}/"
file = partition.last

if partition.first.length.positive?
dir = "#{partition.first}/"
FileUtils.mkdir_p partition.first
dir = "#{dir}#{partition.first}/"
FileUtils.mkdir_p dir
end

File.open("#{dir}#{file}.md", "w") do |f|
Expand Down

0 comments on commit 66a3434

Please sign in to comment.