From 3a8be7b1606885b3b94bc22a6d775a6527e1c07d Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sun, 30 Jul 2023 15:07:28 +0200 Subject: note parsing, tag links --- helpers.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'helpers.rb') diff --git a/helpers.rb b/helpers.rb index 4940b34..bb43303 100644 --- a/helpers.rb +++ b/helpers.rb @@ -135,4 +135,10 @@ helpers do type = extensions.find { |_k, v| v.include? ext } "#{type[0]}/#{ext}" end + + def find_file(id) + Dir[File.join('*', 'object', '*', '*.json')].find do |f| + JSON.parse(File.read(f))['id'] == id + end + end end -- cgit v1.2.3