Skip to content

Commit

Permalink
wip library api
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed May 17, 2023
1 parent 4b211cf commit 4d9f76a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _plugins/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ def generateVersion(site)
site.pages << page2
end

##
# Generates /api/data-library.yaml
# Params:
# +site+:: +Jekyll::Site+ object
# Returns:
# nil
def generateLibrary(site)
puts '[GTN/API] Data Library'
page2 = PageWithoutAFile.new(site, '', 'api/', 'data-library.yaml')
data_libraries = Dir.glob('topics/**/data-library.yaml')
data_libraries.map! { |x| YAML.load_file(x) }
pp data_libraries
page2.content = JSON.pretty_generate(Gtn::Git.discover)
page2.data['layout'] = nil
site.pages << page2
end

##
# Runs the generation process
# Params:
Expand All @@ -114,6 +131,8 @@ def generate(site)
generateConfiguration(site)
# For some reason the templating isn't working right here.
# generateVersion(site)
# TODO:
# generateLibrary(site)

# Full Bibliography
Gtn::Scholar.load_bib(site)
Expand Down

0 comments on commit 4d9f76a

Please sign in to comment.