diff --git a/analyze.rb b/analyze.rb index bb9a17d..9c36ac5 100644 --- a/analyze.rb +++ b/analyze.rb @@ -21,7 +21,7 @@ end files = Set.new refs = {} -ARGF.each do |file| +Dir['content/blog/**/*.md'].each do |file| file = file.chomp files << file arr = refs[file] || (refs[file] = []) @@ -78,5 +78,5 @@ end edges.uniq # edges.filter! { |e| e[:from] < e[:to] } -puts ("const nodes = " + JSON.pretty_unparse(data.values) + ";") -puts ("const edges = " + JSON.pretty_unparse(edges) + ";") +puts ("export const nodes = " + JSON.pretty_unparse(data.values) + ";") +puts ("export const edges = " + JSON.pretty_unparse(edges) + ";")