Add draft link support to analyze.rb
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
bf9b0aedf9
commit
7817c9a4ce
|
@ -25,8 +25,9 @@ Dir['content/blog/**/*.md'].each do |file|
|
|||
file = file.chomp
|
||||
files << file
|
||||
arr = refs[file] || (refs[file] = [])
|
||||
File.open(file).read.scan(/< relref "([^"]+)" >/) do |ref|
|
||||
ref = resolve_path(File.dirname(file), ref[0])
|
||||
pattern = Regexp.union(/< relref "([^"]+)" >/, /< draftlink "[^"]+" "([^"]+)" >/)
|
||||
File.open(file).read.scan(pattern) do |ref|
|
||||
ref = resolve_path(File.dirname(file), ref[0] || ref[1])
|
||||
arr << ref
|
||||
files << ref
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user