From a6582867768c8715faa9908d7f3d7d7b9347a64e Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 15 Mar 2022 15:08:46 -0700 Subject: [PATCH] Make analyze.rb find its own files and generate JS --- analyze.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) + ";")