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 49e650d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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 @@ -146,10 +147,10 @@ def process(options)

if partition.first.length.positive?
dir = "#{partition.first}/"
FileUtils.mkdir_p partition.first
FileUtils.mkdir_p "#{dirs[:_aliases]}/#{dir}"
end

File.open("#{dir}#{file}.md", "w") do |f|
File.open("#{dirs[:_aliases]}/#{dir}#{file}.md", "w") do |f|
f.puts "---"
f.puts "layout: refresh"
f.puts "permalink: #{dir}#{file}/"
Expand Down

0 comments on commit 49e650d

Please sign in to comment.